phoenixnap.bmc.server_ip_block (1.17.0) — module

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 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 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).

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 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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

Inputs

    
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

Outputs

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