hetzner.hcloud.hcloud_server – Create and manage cloud servers on the Hetzner Cloud.¶
Note
This plugin is part of the hetzner.hcloud collection (version 1.2.1).
To install it use: ansible-galaxy collection install hetzner.hcloud
.
To use it in a playbook, specify: hetzner.hcloud.hcloud_server
.
Requirements¶
The below requirements are needed on the host that executes this module.
hcloud-python >= 1.0.0
Parameters¶
See Also¶
See also
- Documentation for Hetzner Cloud API
Complete reference for the Hetzner Cloud API.
Examples¶
- name: Create a basic server
hcloud_server:
name: my-server
server_type: cx11
image: ubuntu-18.04
state: present
- name: Create a basic server with ssh key
hcloud_server:
name: my-server
server_type: cx11
image: ubuntu-18.04
location: fsn1
ssh_keys:
- me@myorganisation
state: present
- name: Resize an existing server
hcloud_server:
name: my-server
server_type: cx21
upgrade_disk: yes
state: present
- name: Ensure the server is absent (remove if needed)
hcloud_server:
name: my-server
state: absent
- name: Ensure the server is started
hcloud_server:
name: my-server
state: started
- name: Ensure the server is stopped
hcloud_server:
name: my-server
state: stopped
- name: Ensure the server is restarted
hcloud_server:
name: my-server
state: restarted
- name: Ensure the server is will be booted in rescue mode and therefore restarted
hcloud_server:
name: my-server
rescue_mode: linux64
state: restarted
- name: Ensure the server is rebuild
hcloud_server:
name: my-server
image: ubuntu-18.04
state: rebuild
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
Lukas Kaemmerling (@LKaemmerling)