phoenixnap.bmc.public_network_ip_block (1.17.0) — module

add/remove an IP block from a public network.

| "added in version" 1.11.0 of phoenixnap.bmc"

Authors: Pavle Jojkic (@pajuga) <pavlej@phoenixnap.com>, Goran Jelenic (@goranje) <goranje@phoenixnap.com>

preview | supported by certified

Install collection

Install with ansible-galaxy collection install phoenixnap.bmc:==1.17.0


Add to requirements.yml

  collections:
    - name: phoenixnap.bmc
      version: 1.17.0

Description

add/remove an IP block from a public network.

This module has a dependency on requests

API is documented at U(https://developers.phoenixnap.com/docs/networks/1/overview).

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# 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 public network.
  hosts: localhost
  gather_facts: false
  vars_files:
    - ~/.pnap/config.yaml
  tasks:
    - name: Add an IP block to public network.
      phoenixnap.bmc.public_network_ip_block:
        client_id: "{{ clientId }}"
        client_secret: "{{ clientSecret }}"
        public_network_id: e6afba51-7de8-4080-83ab-0f915570659c
        ip_block_id: 60473a6115e34466c9f8f083
        state: present
      register: output
    - name: Print the public network information
      ansible.builtin.debug:
        var: output.public_network_ip_block
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove an IP block from public network.
  hosts: localhost
  gather_facts: false
  vars_files:
    - ~/.pnap/config.yaml
  tasks:
    - name: Remove an IP block from public network.
      phoenixnap.bmc.public_network_ip_block:
        client_id: "{{ clientId }}"
        client_secret: "{{ clientSecret }}"
        public_network_id: e6afba51-7de8-4080-83ab-0f915570659c
        ip_block_id: 60473a6115e34466c9f8f083
        state: absent
      register: output
    - name: Print the public network information
      ansible.builtin.debug:
        var: output.public_network_ip_block

Inputs

    
force:
    default: false
    description: parameter controlling advanced features availability.
    type: bool

state:
    choices:
    - present
    - absent
    default: present
    description: Indicate desired state of the target.
    type: str

client_id:
    description: Client ID (Application Management)
    type: str

ip_block_id:
    description: The IP Block identifier.
    required: true
    type: str

client_secret:
    description: Client Secret (Application Management)
    type: str

public_network_id:
    description: The Public Network identifier.
    required: true
    type: str

Outputs

public_network_ip_block:
  contains:
    id:
      description: The IP Block identifier.
      returned: always
      sample: 60473a6115e34466c9f8f083
      type: str
  description: The specified IP block information
  returned: success
  type: complex