phoenixnap / phoenixnap.bmc / 1.17.0 / module / server_ip_block add/remove an IP block from a server. | "added in version" 1.10.0 of phoenixnap.bmc" Authors: Pavle Jojkic (@pajuga) <pavlej@phoenixnap.com>, Goran Jelenic (@goranje) <goranje@phoenixnap.com> preview | supported by certifiedphoenixnap.bmc.server_ip_block (1.17.0) — module
Install with ansible-galaxy collection install phoenixnap.bmc:==1.17.0
collections: - name: phoenixnap.bmc version: 1.17.0
add/remove an IP block from a server.
No actual configuration is performed on the operating system.
This module has a dependency on requests
API is documented at U(https://developers.phoenixnap.com/docs/bmc/1/overview).
# All the examples assume that you have file config.yaml with your 'clientId' and 'clientSecret' # in location: ~/.pnap/config.yaml - name: Add an IP block to server. hosts: localhost gather_facts: false vars_files: - ~/.pnap/config.yaml tasks: - name: Add an IP block to server. phoenixnap.bmc.server_ip_block: client_id: "{{ clientId }}" client_secret: "{{ clientSecret }}" server_id: e6afba51-7de8-4080-83ab-0f915570659c ip_block_id: 60473a6115e34466c9f8f083 state: present register: output - name: Print the server ip block information ansible.builtin.debug: var: output.server_ip_block
- name: Remove an IP block from server. hosts: localhost gather_facts: false vars_files: - ~/.pnap/config.yaml tasks: - name: Remove an IP block from server. phoenixnap.bmc.server_ip_block: client_id: "{{ clientId }}" client_secret: "{{ clientSecret }}" server_id: e6afba51-7de8-4080-83ab-0f915570659c ip_block_id: 60473a6115e34466c9f8f083 delete_ip_blocks: true state: absent register: output - name: Print the server ip block information ansible.builtin.debug: var: output.server_ip_block
state: choices: - present - absent default: present description: Indicate desired state of the target. type: str vlan_id: description: The VLAN on which this IP block has been configured within the network switch. type: int client_id: description: Client ID (Application Management) type: str server_id: description: The server's ID. required: true type: str ip_block_id: description: The IP block's ID. required: true type: str client_secret: description: Client Secret (Application Management) type: str delete_ip_blocks: default: false description: Determines whether the IP blocks assigned to the server should be deleted or not. type: bool
server_ip_block: contains: id: description: The IP block's ID. returned: always sample: 60473a6115e34466c9f8f083 type: str vlanId: description: The VLAN on which this IP block has been configured within the network switch. returned: always sample: 10 type: int description: The specified IP block information returned: success type: complex