phoenixnap.bmc.server_private_network (1.17.0) — module

add/remove the server to/from a private network

| "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 the server to/from a private network

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 the server to a private network.
  hosts: localhost
  gather_facts: false
  vars_files:
    - ~/.pnap/config.yaml
  tasks:
    - name: Add the server to a private network.
      phoenixnap.bmc.server_private_network:
        client_id: "{{ clientId }}"
        client_secret: "{{ clientSecret }}"
        server_id: e6afba51-7de8-4080-83ab-0f915570659c
        private_network_id: 60473a6115e34466c9f8f083
        ips:
          - 10.0.0.1
          - 10.0.0.2
        dhcp: false
        state: present
      register: output
    - name: Print the server private network information
      ansible.builtin.debug:
        var: output.server_private_network
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove the server from private network.
  hosts: localhost
  gather_facts: false
  vars_files:
    - ~/.pnap/config.yaml
  tasks:
    - name: Remove the server from private network.
      phoenixnap.bmc.server_private_network:
        client_id: "{{ clientId }}"
        client_secret: "{{ clientSecret }}"
        server_id: e6afba51-7de8-4080-83ab-0f915570659c
        private_network_id: 60473a6115e34466c9f8f083
        state: absent
      register: output
    - name: Print the server private_network information
      ansible.builtin.debug:
        var: output.server_private_network

Inputs

    
ips:
    description:
    - IPs to configure/configured on the server.
    - Should be null or empty list if DHCP is true. IPs must be within the network's range.
    - If field is undefined and DHCP is false, next available IP in network will be automatically
      allocated.
    - If the network contains a membership of type 'storage', the first twelve IPs are
      already reserved by BMC and not usable.
    - Setting the force query parameter to true allows you to assign no specific IP addresses
      by designating an empty array of IPs and assign one or more IP addresses which are
      already configured on other resource(s) in network.
    elements: str
    type: list

dhcp:
    description: Determines whether DHCP is enabled for this server. Should be false if
      any IPs are provided.
    type: bool

force:
    description:
    - parameter controlling advanced features availability.
    - Currently applicable for networking. It is advised to use with caution since it
      might lead to unhealthy setups.
    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

server_id:
    description: The server's ID.
    required: true
    type: str

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

private_network_id:
    description: The network identifier.
    required: true
    type: str

Outputs

server_private_network:
  contains:
    dhcp:
      description: Determines whether DHCP is enabled for this server.
      returned: always
      sample: false
      type: bool
    id:
      description: The network identifier.
      returned: always
      sample: 603f3b2cfcaf050643b89a4b
      type: str
    ips:
      description: IPs to configure/configured on the server.
      elements: str
      returned: always
      sample:
      - 10.1.1.1
      - 10.1.1.2
      type: list
    statusDescription:
      description: The status of the network.
      returned: always
      sample: assigned
      type: str
  description: The specified private_network information
  returned: success
  type: complex