phoenixnap.bmc.ip_block_info (1.17.0) — module

Gather information about phoenixNAP public IP blocks.

| "added in version" 1.2.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

Retrieves all public IP blocks associated with the authenticated account.

This module has a dependency on requests

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: List IP blocks
  hosts: localhost
  gather_facts: false
  vars_files:
    - ~/.pnap/config.yaml
  tasks:
    - name: List IP blocks
      phoenixnap.bmc.ip_block_info:
        client_id: "{{ clientId }}"
        client_secret: "{{ clientSecret }}"
      register: output
    - name: Print the gathered infos
      ansible.builtin.debug:
        var: output.ip_blocks

Inputs

    
status:
    description: Filter by IP Block status.
    elements: str
    type: list

location:
    description: Filter by IP Block location.
    elements: str
    type: list

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

description:
    description: Filter by IP Block description.
    elements: str
    type: list

ip_block_id:
    aliases:
    - ids
    description: Filter by IP Block identifiers.
    elements: str
    type: list

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

cidr_block_size:
    description: Filter by IP CIDR Block Size.
    elements: str
    type: list

Outputs

ip_blocks:
  contains:
    assignedResourceId:
      description: ID of the resource assigned to the IP Block.
      returned: always
      sample: 6047127fed34ecc3ba8402d2
      type: str
    assignedResourceType:
      description: Type of the resource assigned to the IP Block.
      returned: always
      sample: server
      type: str
    cidr:
      description: The IP Block in CIDR notation.
      returned: always
      sample: 1.1.1.0/31
      type: str
    cidrBlockSize:
      description: CIDR IP Block Size.
      sample: /30
      type: str
    createdOn:
      description: Date and time when the IP block was created.
      sample: '2021-03-13T20:24:32.491Z'
      type: str
    description:
      description: The description of the IP Block.
      sample: IP Block
      type: str
    id:
      description: IP Block identifier.
      returned: always
      sample: 6047127fed34ecc3ba8402d2
      type: str
    isBringYourOwn:
      description: True if the IP block is a bring your own block.
      sample: true
      type: bool
    location:
      description: IP Block location ID.
      returned: always
      sample: PHX
      type: str
    status:
      description: The status of the IP Block.
      returned: always
      sample: unassigned
      type: str
    tags:
      contains:
        createdBy:
          description: Who the tag was created by.
          sample: USER
          type: str
        id:
          description: The unique id of the tag.
          sample: 60ffafcdffb8b074c7968dad
          type: str
        isBillingTag:
          description: Whether or not to show the tag as part of billing and invoices
          sample: true
          type: bool
        name:
          description: The name of the tag.
          sample: Environment
          type: str
        value:
          description: The value of the tag assigned to the resource.
          sample: PROD
          type: str
      description: The tags assigned if any.
      returned: always
      type: list
  description: The ip blocks information as list
  returned: success
  type: complex