community.general.oneandone_private_network (8.5.0) — module

Configure 1&1 private networking

Authors: Amel Ajdinovic (@aajdinov), Ethan Devenport (@edevenport)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

Create, remove, reconfigure, update a private network. This module has a dependency on 1and1 >= 1.0.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a private network
  community.general.oneandone_private_network:
    auth_token: oneandone_private_api_key
    name: backup_network
    description: Testing creation of a private network with ansible
    network_address: 70.35.193.100
    subnet_mask: 255.0.0.0
    datacenter: US
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Destroy a private network
  community.general.oneandone_private_network:
    auth_token: oneandone_private_api_key
    state: absent
    name: backup_network
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Modify the private network
  community.general.oneandone_private_network:
    auth_token: oneandone_private_api_key
    state: update
    private_network: backup_network
    network_address: 192.168.2.0
    subnet_mask: 255.255.255.0
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Add members to the private network
  community.general.oneandone_private_network:
    auth_token: oneandone_private_api_key
    state: update
    private_network: backup_network
    add_members:
     - server identifier (id or name)
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove members from the private network
  community.general.oneandone_private_network:
    auth_token: oneandone_private_api_key
    state: update
    private_network: backup_network
    remove_members:
     - server identifier (id or name)

Inputs

    
name:
    description:
    - Private network name used with present state. Used as identifier (id or name) when
      used with absent state.
    type: str

wait:
    default: true
    description:
    - wait for the instance to be in state 'running' before returning
    required: false
    type: bool

state:
    choices:
    - present
    - absent
    - update
    default: present
    description:
    - Define a network's state to create, remove, or update.
    required: false
    type: str

api_url:
    description:
    - Custom API URL. Overrides the ONEANDONE_API_URL environment variable.
    required: false
    type: str

auth_token:
    description:
    - Authenticating API token provided by 1&1.
    type: str

datacenter:
    choices:
    - US
    - ES
    - DE
    - GB
    description:
    - The identifier of the datacenter where the private network will be created
    type: str

add_members:
    default: []
    description:
    - List of server identifiers (name or id) to be added to the private network.
    elements: str
    type: list

description:
    description:
    - Set a description for the network.
    type: str

subnet_mask:
    description:
    - Set the netmask for the private network, i.e. 255.255.255.0
    type: str

wait_timeout:
    default: 600
    description:
    - how long before wait gives up, in seconds
    type: int

wait_interval:
    default: 5
    description:
    - Defines the number of seconds to wait when using the _wait_for methods
    type: int

remove_members:
    default: []
    description:
    - List of server identifiers (name or id) to be removed from the private network.
    elements: str
    type: list

network_address:
    description:
    - Set a private network space, i.e. 192.168.1.0
    type: str

private_network:
    description:
    - The identifier (id or name) of the network used with update state.
    type: str

Outputs

private_network:
  description: Information about the private network.
  returned: always
  sample: '{"name": "backup_network", "id": "55726DEDA20C99CF6F2AF8F18CAC9963"}'
  type: dict