community / community.general / 0.1.4 / module / oneandone_server Create, destroy, start, stop, and reboot a 1&1 Host server. Authors: Amel Ajdinovic (@aajdinov), Ethan Devenport (@edevenport)community.general.oneandone_server (0.1.4) — module
Install with ansible-galaxy collection install community.general:==0.1.4
collections: - name: community.general version: 0.1.4
Create, destroy, update, start, stop, and reboot a 1&1 Host server. When the server is created it can optionally wait for it to be 'running' before returning.
- name: Create three servers and enumerate their names oneandone_server: auth_token: oneandone_private_api_key hostname: node%02d fixed_instance_size: XL datacenter: US appliance: C5A349786169F140BCBC335675014C08 auto_increment: true count: 3
- name: Create three servers, passing in an ssh_key oneandone_server: auth_token: oneandone_private_api_key hostname: node%02d vcore: 2 cores_per_processor: 4 ram: 8.0 hdds: - size: 50 is_main: false datacenter: ES appliance: C5A349786169F140BCBC335675014C08 count: 3 wait: yes wait_timeout: 600 wait_interval: 10 ssh_key: SSH_PUBLIC_KEY
- name: Removing server oneandone_server: auth_token: oneandone_private_api_key state: absent server: 'node01'
- name: Starting server oneandone_server: auth_token: oneandone_private_api_key state: running server: 'node01'
- name: Stopping server oneandone_server: auth_token: oneandone_private_api_key state: stopped server: 'node01'
ram: description: - The amount of RAM memory. It must be provided with with vcore, cores_per_processor, and hdds parameters. hdds: description: - A list of hard disks with nested "size" and "is_main" properties. It must be provided with vcore, cores_per_processor, and ram parameters. wait: default: 'yes' description: - Wait for the server to be in state 'running' before returning. Also used for delete operation (set to 'false' if you don't want to wait for each individual server to be deleted before moving on with other tasks.) type: bool count: default: 1 description: - The number of servers to create. state: choices: - present - absent - running - stopped default: present description: - Define a server's state to create, remove, start or stop it. vcore: description: - The total number of processors. It must be provided with cores_per_processor, ram, and hdds parameters. server: description: - Server identifier (ID or hostname). It is required for all states except 'running' and 'present'. api_url: description: - Custom API URL. Overrides the ONEANDONE_API_URL environment variable. ssh_key: description: - User's public SSH key (contents, not path). hostname: description: - The hostname or ID of the server. Only used when state is 'present'. appliance: description: - The operating system name or ID for the server. It is required only for 'present' state. auth_token: description: - Authenticating API token provided by 1&1. Overrides the ONEANDONE_AUTH_TOKEN environment variable. required: true datacenter: choices: - US - ES - DE - GB default: US description: - The datacenter location. description: description: - The description of the server. server_type: choices: - cloud - baremetal - k8s_node default: cloud description: - The type of server to be built. wait_timeout: default: 600 description: - how long before wait gives up, in seconds load_balancer: description: - The load balancer name or ID. wait_interval: default: 5 description: - Defines the number of seconds to wait when using the wait_for methods auto_increment: default: 'yes' description: - When creating multiple servers at once, whether to differentiate hostnames by appending a count after them or substituting the count where there is a %02d or %03d in the hostname string. type: bool firewall_policy: description: - The firewall policy name or ID. private_network: description: - The private network name or ID. monitoring_policy: description: - The monitoring policy name or ID. cores_per_processor: description: - The number of cores per processor. It must be provided with vcore, ram, and hdds parameters. fixed_instance_size: choices: - S - M - L - XL - XXL - 3XL - 4XL - 5XL description: - The instance size name or ID of the server. It is required only for 'present' state, and it is mutually exclusive with vcore, cores_per_processor, ram, and hdds parameters. required: true
servers: description: Information about each server that was processed returned: always sample: '[{"hostname": "my-server", "id": "server-id"}]' type: list