phoenixnap / phoenixnap.bmc / 1.4.0 / module / network Create/delete network on phoenixNAP Bare Metal Cloud. | "added in version" 0.11.0 of phoenixnap.bmc" Authors: Pavle Jojkic (@pajuga) <pavlej@phoenixnap.com>, Goran Jelenic (@goranje) <goranje@phoenixnap.com> preview | supported by certifiedphoenixnap.bmc.network (1.4.0) — module
Install with ansible-galaxy collection install phoenixnap.bmc:==1.4.0
collections: - name: phoenixnap.bmc version: 1.4.0
Create/delete network on phoenixNAP Bare Metal Cloud.
This module has a dependency on requests
API is documented at U(https://developers.phoenixnap.com/docs/networks/1/overview).
# All the examples assume that you have file config.yaml with your 'clientId' and 'clientSecret' # in location: ~/.pnap/config.yaml # Create network - name: Create new network for account hosts: localhost gather_facts: false vars_files: - ~/.pnap/config.yaml collections: - phoenixnap.bmc tasks: - phoenixnap.bmc.network: client_id: "{{clientId}}" client_secret: "{{clientSecret}}" name: My Default Backend Network location: PHX location_default: true description: My Default Backend Network cidr: 10.0.0.0/24 state: present register: output - name: Print the networks information debug: var: output.networks
# Delete network - name: Delete network hosts: localhost gather_facts: false vars_files: - ~/.pnap/config.yaml collections: - phoenixnap.bmc tasks: - phoenixnap.bmc.network: client_id: "{{clientId}}" client_secret: "{{clientSecret}}" name: My Default Backend Network state: absent register: output - name: Print the networks information debug: var: output.networks
cidr: description: IP range associated with this private network in CIDR notation. type: str name: description: The friendly name of this private network. type: str state: choices: - present - absent default: present description: Indicate desired state of the target. type: str location: description: - The location of this private network. - Once a network is created, it cannot be modified through a playbook type: str client_id: description: Client ID (Application Management) type: str description: description: The description of this private network. type: str client_secret: description: Client Secret (Application Management) type: str location_default: default: false description: - Identifies network as the default private network for the specified location. - Once a network is created, it cannot be modified through a playbook type: bool
changed: description: True if a network was created or removed. returned: success sample: true type: bool network: description: Information about network that was created/removed returned: success sample: '{"id": "604724a5a807f2d3be8660c7", "name": My Default Backend Network, "type": "PRIVATE", "location": "PHX", "locationDefault": true, "vlanId": 10, "description": "My Default Backend Network", "cidr": "10.0.0.0/24", "servers": []}' type: dict