summaryrefslogtreecommitdiffstats
path: root/ansible_collections/community/hrobot/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'ansible_collections/community/hrobot/plugins')
-rw-r--r--ansible_collections/community/hrobot/plugins/inventory/robot.py27
-rw-r--r--ansible_collections/community/hrobot/plugins/module_utils/robot.py37
-rw-r--r--ansible_collections/community/hrobot/plugins/modules/boot.py44
-rw-r--r--ansible_collections/community/hrobot/plugins/modules/failover_ip.py8
-rw-r--r--ansible_collections/community/hrobot/plugins/modules/failover_ip_info.py4
-rw-r--r--ansible_collections/community/hrobot/plugins/modules/firewall.py46
-rw-r--r--ansible_collections/community/hrobot/plugins/modules/firewall_info.py20
-rw-r--r--ansible_collections/community/hrobot/plugins/modules/reset.py8
-rw-r--r--ansible_collections/community/hrobot/plugins/modules/reverse_dns.py6
-rw-r--r--ansible_collections/community/hrobot/plugins/modules/server.py2
-rw-r--r--ansible_collections/community/hrobot/plugins/modules/server_info.py24
-rw-r--r--ansible_collections/community/hrobot/plugins/modules/ssh_key.py16
-rw-r--r--ansible_collections/community/hrobot/plugins/modules/v_switch.py6
13 files changed, 143 insertions, 105 deletions
diff --git a/ansible_collections/community/hrobot/plugins/inventory/robot.py b/ansible_collections/community/hrobot/plugins/inventory/robot.py
index 1d5af4537..19a2f1aa4 100644
--- a/ansible_collections/community/hrobot/plugins/inventory/robot.py
+++ b/ansible_collections/community/hrobot/plugins/inventory/robot.py
@@ -26,7 +26,7 @@ DOCUMENTATION = r"""
- ansible.builtin.inventory_cache
- community.hrobot.robot
notes:
- - The I(hetzner_user) and I(hetzner_password) options can be templated.
+ - The O(hetzner_user) and O(hetzner_password) options can be templated.
options:
plugin:
description: Token that ensures this is a source file for the plugin.
@@ -38,13 +38,17 @@ DOCUMENTATION = r"""
hetzner_password:
env:
- name: HROBOT_API_PASSWORD
- filters:
+ simple_filters:
description:
- A dictionary of filter value pairs.
- Available filters are listed here are keys of server like C(status) or C(server_ip).
- See U(https://robot.your-server.de/doc/webservice/en.html#get-server) for all values that can be used.
+ - This option has been renamed from O(filters) to O(simple_filters) in community.hrobot 1.9.0.
+ The old name can still be used until community.hrobot 2.0.0.
type: dict
default: {}
+ aliases:
+ - filters
"""
EXAMPLES = r"""
@@ -63,7 +67,7 @@ hetzner_password: '{{ (lookup("community.sops.sops", "keys/hetzner.sops.yaml") |
# Example using constructed features to create groups
plugin: community.hrobot.robot
-filters:
+simple_filters:
status: ready
traffic: unlimited
# keyed_groups may be used to create custom groups
@@ -81,6 +85,7 @@ from ansible.errors import AnsibleError
from ansible.plugins.inventory import BaseInventoryPlugin, Constructable, Cacheable
from ansible.template import Templar
from ansible.utils.display import Display
+from ansible.utils.unsafe_proxy import wrap_var as make_unsafe
from ansible_collections.community.hrobot.plugins.module_utils.robot import (
BASE_URL,
@@ -109,10 +114,18 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
def parse(self, inventory, loader, path, cache=True):
super(InventoryModule, self).parse(inventory, loader, path)
servers = {}
- config = self._read_config_data(path)
+ orig_config = self._read_config_data(path)
self.load_cache_plugin()
cache_key = self.get_cache_key(path)
+ if 'filters' in orig_config:
+ display.deprecated(
+ 'The `filters` option of the community.hrobot.robot inventory plugin has been renamed to `simple_filters`. '
+ 'The old name will stop working in community.hrobot 2.0.0.',
+ collection_name='community.hrobot',
+ version='2.0.0',
+ )
+
self.templar = Templar(loader=loader)
# cache may be True or False at this point to indicate if the inventory is being refreshed
@@ -143,7 +156,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
self.populate(servers)
def populate(self, servers):
- filters = self.get_option('filters')
+ filters = self.get_option('simple_filters')
strict = self.get_option('strict')
server_lists = []
for server in servers:
@@ -162,9 +175,9 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
self.inventory.add_host(server_name)
server_lists.append(server_name)
if 'server_ip' in s:
- self.inventory.set_variable(server_name, 'ansible_host', s['server_ip'])
+ self.inventory.set_variable(server_name, 'ansible_host', make_unsafe(s['server_ip']))
for hostvar, hostval in s.items():
- self.inventory.set_variable(server_name, "{0}_{1}".format('hrobot', hostvar), hostval)
+ self.inventory.set_variable(server_name, "{0}_{1}".format('hrobot', hostvar), make_unsafe(hostval))
# Composed variables
server_vars = self.inventory.get_host(server_name).get_vars()
diff --git a/ansible_collections/community/hrobot/plugins/module_utils/robot.py b/ansible_collections/community/hrobot/plugins/module_utils/robot.py
index 034a3fc48..f01409083 100644
--- a/ansible_collections/community/hrobot/plugins/module_utils/robot.py
+++ b/ansible_collections/community/hrobot/plugins/module_utils/robot.py
@@ -8,6 +8,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
+from ansible.module_utils.common.text.converters import to_native
from ansible.module_utils.six import PY3
from ansible.module_utils.six.moves.urllib.error import HTTPError
from ansible.module_utils.urls import fetch_url, open_url
@@ -33,6 +34,30 @@ def get_x_www_form_urlenconded_dict_from_list(key, values):
return dict(('{key}[{index}]'.format(key=key, index=i), x) for i, x in enumerate(values))
+def _format_list(obj):
+ if not isinstance(obj, (list, tuple)):
+ return to_native(obj)
+ return [_format_list(e) for e in obj]
+
+
+def format_error_msg(error):
+ # Reference: https://robot.hetzner.com/doc/webservice/en.html#errors
+ msg = 'Request failed: {0} {1} ({2})'.format(
+ error['status'],
+ error['code'],
+ error['message'],
+ )
+ if error.get('missing'):
+ msg += '. Missing input parameters: {0}'.format(_format_list(error['missing']))
+ if error.get('invalid'):
+ msg += '. Invalid input parameters: {0}'.format(_format_list(error['invalid']))
+ if error.get('max_request') is not None:
+ msg += '. Maximum allowed requests: {0}'.format(error['max_request'])
+ if error.get('interval') is not None:
+ msg += '. Time interval in seconds: {0}'.format(error['interval'])
+ return msg
+
+
class PluginException(Exception):
def __init__(self, message):
super(PluginException, self).__init__(message)
@@ -85,11 +110,7 @@ def plugin_open_url_json(plugin, url, method='GET', timeout=10, data=None, heade
if accept_errors:
if result['error']['code'] in accept_errors:
return result, result['error']['code']
- raise PluginException('Request failed: {0} {1} ({2})'.format(
- result['error']['status'],
- result['error']['code'],
- result['error']['message']
- ))
+ raise PluginException(format_error_msg(result['error']))
return result, None
except ValueError:
raise PluginException('Cannot decode content retrieved from {0}'.format(url))
@@ -125,11 +146,7 @@ def fetch_url_json(module, url, method='GET', timeout=10, data=None, headers=Non
if accept_errors:
if result['error']['code'] in accept_errors:
return result, result['error']['code']
- module.fail_json(msg='Request failed: {0} {1} ({2})'.format(
- result['error']['status'],
- result['error']['code'],
- result['error']['message']
- ))
+ module.fail_json(msg=format_error_msg(result['error']), error=result['error'])
return result, None
except ValueError:
module.fail_json(msg='Cannot decode content retrieved from {0}'.format(url))
diff --git a/ansible_collections/community/hrobot/plugins/modules/boot.py b/ansible_collections/community/hrobot/plugins/modules/boot.py
index 64917d9b8..bcf6f3c47 100644
--- a/ansible_collections/community/hrobot/plugins/modules/boot.py
+++ b/ansible_collections/community/hrobot/plugins/modules/boot.py
@@ -46,31 +46,31 @@ options:
description:
- If this option is provided, all special boot configurations are removed and
the installed operating system will be booted up next (assuming it is bootable).
- - Precisely one of I(regular_boot), I(rescue), I(install_linux), I(install_vnc),
- I(install_windows), I(install_plesk), and I(install_cpanel) must be provided.
+ - Precisely one of O(regular_boot), O(rescue), O(install_linux), O(install_vnc),
+ O(install_windows), O(install_plesk), and O(install_cpanel) must be provided.
type: bool
choices:
- true
rescue:
description:
- If this option is provided, the rescue system will be activated for the next boot.
- - Precisely one of I(regular_boot), I(rescue), I(install_linux), I(install_vnc),
- I(install_windows), I(install_plesk), and I(install_cpanel) must be provided.
+ - Precisely one of O(regular_boot), O(rescue), O(install_linux), O(install_vnc),
+ O(install_windows), O(install_plesk), and O(install_cpanel) must be provided.
type: dict
suboptions:
os:
description:
- The operating system to use for the rescue system. Possible choices can
change over time.
- - Currently, C(linux), C(linuxold), C(freebsd), C(freebsdold), C(freebsdax),
- C(freebsdbetaax), C(vkvm), and C(vkvmold) seem to be available.
+ - Currently, V(linux), V(linuxold), V(freebsd), V(freebsdold), V(freebsdax),
+ V(freebsdbetaax), V(vkvm), and V(vkvmold) seem to be available.
type: str
required: true
arch:
description:
- The architecture to use for the rescue system.
- Not all architectures are available for all operating systems.
- - Defaults to C(64).
+ - Defaults to V(64).
type: int
choices:
- 32
@@ -87,8 +87,8 @@ options:
install_linux:
description:
- If this option is provided, a Linux system install will be activated for the next boot.
- - Precisely one of I(regular_boot), I(rescue), I(install_linux), I(install_vnc),
- I(install_windows), I(install_plesk), and I(install_cpanel) must be provided.
+ - Precisely one of O(regular_boot), O(rescue), O(install_linux), O(install_vnc),
+ O(install_windows), O(install_plesk), and O(install_cpanel) must be provided.
type: dict
suboptions:
dist:
@@ -100,7 +100,7 @@ options:
description:
- The architecture to use for the install.
- Not all architectures are available for all distributions.
- - Defaults to C(64).
+ - Defaults to V(64).
type: int
choices:
- 32
@@ -122,8 +122,8 @@ options:
install_vnc:
description:
- If this option is provided, a VNC installation will be activated for the next boot.
- - Precisely one of I(regular_boot), I(rescue), I(install_linux), I(install_vnc),
- I(install_windows), I(install_plesk), and I(install_cpanel) must be provided.
+ - Precisely one of O(regular_boot), O(rescue), O(install_linux), O(install_vnc),
+ O(install_windows), O(install_plesk), and O(install_cpanel) must be provided.
type: dict
suboptions:
dist:
@@ -135,7 +135,7 @@ options:
description:
- The architecture to use for the install.
- Not all architectures are available for all distributions.
- - Defaults to C(64).
+ - Defaults to V(64).
type: int
choices:
- 32
@@ -148,8 +148,8 @@ options:
install_windows:
description:
- If this option is provided, a Windows installation will be activated for the next boot.
- - Precisely one of I(regular_boot), I(rescue), I(install_linux), I(install_vnc),
- I(install_windows), I(install_plesk), and I(install_cpanel) must be provided.
+ - Precisely one of O(regular_boot), O(rescue), O(install_linux), O(install_vnc),
+ O(install_windows), O(install_plesk), and O(install_cpanel) must be provided.
type: dict
suboptions:
lang:
@@ -160,8 +160,8 @@ options:
install_plesk:
description:
- If this option is provided, a Plesk installation will be activated for the next boot.
- - Precisely one of I(regular_boot), I(rescue), I(install_linux), I(install_vnc),
- I(install_windows), I(install_plesk), and I(install_cpanel) must be provided.
+ - Precisely one of O(regular_boot), O(rescue), O(install_linux), O(install_vnc),
+ O(install_windows), O(install_plesk), and O(install_cpanel) must be provided.
type: dict
suboptions:
dist:
@@ -173,7 +173,7 @@ options:
description:
- The architecture to use for the install.
- Not all architectures are available for all distributions.
- - Defaults to C(64).
+ - Defaults to V(64).
type: int
choices:
- 32
@@ -191,8 +191,8 @@ options:
install_cpanel:
description:
- If this option is provided, a cPanel installation will be activated for the next boot.
- - Precisely one of I(regular_boot), I(rescue), I(install_linux), I(install_vnc),
- I(install_windows), I(install_plesk), and I(install_cpanel) must be provided.
+ - Precisely one of O(regular_boot), O(rescue), O(install_linux), O(install_vnc),
+ O(install_windows), O(install_plesk), and O(install_cpanel) must be provided.
type: dict
suboptions:
dist:
@@ -204,7 +204,7 @@ options:
description:
- The architecture to use for the install.
- Not all architectures are available for all distributions.
- - Defaults to C(64).
+ - Defaults to V(64).
type: int
choices:
- 32
@@ -266,7 +266,7 @@ password:
- The root password for the active boot configuration, if available.
- For non-rescue boot configurations, it is avised to change the root password
as soon as possible.
- returned: success and if a boot configuration other than C(regular_boot) is active
+ returned: success and if RV(configuration_type) is not V(regular_boot)
type: str
'''
diff --git a/ansible_collections/community/hrobot/plugins/modules/failover_ip.py b/ansible_collections/community/hrobot/plugins/modules/failover_ip.py
index da2da356a..e5d0fdae7 100644
--- a/ansible_collections/community/hrobot/plugins/modules/failover_ip.py
+++ b/ansible_collections/community/hrobot/plugins/modules/failover_ip.py
@@ -44,7 +44,7 @@ options:
state:
description:
- Defines whether the IP will be routed or not.
- - If set to C(routed), I(value) must be specified.
+ - If set to V(routed), O(value) must be specified.
type: str
choices:
- routed
@@ -53,7 +53,7 @@ options:
value:
description:
- The new value for the failover IP address.
- - Required when setting I(state) to C(routed).
+ - Required when setting O(state) to V(routed).
type: str
timeout:
description:
@@ -85,12 +85,12 @@ RETURN = r'''
value:
description:
- The value of the failover IP.
- - Will be C(none) if the IP is unrouted.
+ - Will be V(none) if the IP is unrouted.
returned: success
type: str
state:
description:
- - Will be C(routed) or C(unrouted).
+ - Will be V(routed) or V(unrouted).
returned: success
type: str
'''
diff --git a/ansible_collections/community/hrobot/plugins/modules/failover_ip_info.py b/ansible_collections/community/hrobot/plugins/modules/failover_ip_info.py
index b656b0499..1db0d1b2c 100644
--- a/ansible_collections/community/hrobot/plugins/modules/failover_ip_info.py
+++ b/ansible_collections/community/hrobot/plugins/modules/failover_ip_info.py
@@ -59,12 +59,12 @@ RETURN = r'''
value:
description:
- The value of the failover IP.
- - Will be C(none) if the IP is unrouted.
+ - Will be V(none) if the IP is unrouted.
returned: success
type: str
state:
description:
- - Will be C(routed) or C(unrouted).
+ - Will be V(routed) or V(unrouted).
returned: success
type: str
failover_ip:
diff --git a/ansible_collections/community/hrobot/plugins/modules/firewall.py b/ansible_collections/community/hrobot/plugins/modules/firewall.py
index 2677a1186..8f158eaa6 100644
--- a/ansible_collections/community/hrobot/plugins/modules/firewall.py
+++ b/ansible_collections/community/hrobot/plugins/modules/firewall.py
@@ -44,14 +44,14 @@ options:
server_ip:
description:
- The server's main IP address.
- - Exactly one of I(server_ip) and I(server_number) must be specified.
+ - Exactly one of O(server_ip) and O(server_number) must be specified.
- Note that Hetzner deprecated identifying the server's firewall by the server's main IP.
- Using this option can thus stop working at any time in the future. Use I(server_number) instead.
+ Using this option can thus stop working at any time in the future. Use O(server_number) instead.
type: str
server_number:
description:
- The server's number.
- - Exactly one of I(server_ip) and I(server_number) must be specified.
+ - Exactly one of O(server_ip) and O(server_number) must be specified.
type: int
version_added: 1.8.0
filter_ipv6:
@@ -69,7 +69,7 @@ options:
state:
description:
- Status of the firewall.
- - Firewall is active if state is C(present), and disabled if state is C(absent).
+ - Firewall is active if state is V(present), and disabled if state is V(absent).
type: str
default: present
choices: [ present, absent ]
@@ -93,11 +93,14 @@ options:
name:
description:
- Name of the firewall rule.
+ - Note that Hetzner restricts the characters that can be used for rule names. At the moment, only
+ letters C(a-z), C(A-Z), space, and the symbols C(.), C(-), C(+), C(_), and C(@) are allowed.
type: str
ip_version:
description:
- Internet protocol version.
- - Leave away to filter both protocols. Note that in that case, none of I(dst_ip), I(src_ip), or I(protocol) can be specified.
+ - Leave away to filter both protocols. Note that in that case, none of O(rules.input[].dst_ip),
+ O(rules.input[].src_ip), or O(rules.input[].protocol) can be specified.
type: str
dst_ip:
description:
@@ -124,8 +127,8 @@ options:
tcp_flags:
description:
- TCP flags or logical combination of flags.
- - Flags supported by Hetzner are C(syn), C(fin), C(rst), C(psh) and C(urg).
- - They can be combined with C(|) (logical or) and C(&) (logical and).
+ - Flags supported by Hetzner are V(syn), V(fin), V(rst), V(psh) and V(urg).
+ - They can be combined with V(|) (logical or) and V(&) (logical and).
- See L(the documentation,https://wiki.hetzner.de/index.php/Robot_Firewall/en#Parameter)
for more information.
type: str
@@ -145,11 +148,14 @@ options:
name:
description:
- Name of the firewall rule.
+ - Note that Hetzner restricts the characters that can be used for rule names. At the moment, only
+ letters C(a-z), C(A-Z), space, and the symbols C(.), C(-), C(+), C(_), and C(@) are allowed.
type: str
ip_version:
description:
- Internet protocol version.
- - Leave away to filter both protocols. Note that in that case, none of I(dst_ip), I(src_ip), or I(protocol) can be specified.
+ - Leave away to filter both protocols. Note that in that case, none of O(rules.output[].dst_ip),
+ O(rules.output[].src_ip), or O(rules.output[].protocol) can be specified.
type: str
dst_ip:
description:
@@ -176,8 +182,8 @@ options:
tcp_flags:
description:
- TCP flags or logical combination of flags.
- - Flags supported by Hetzner are C(syn), C(fin), C(rst), C(psh) and C(urg).
- - They can be combined with C(|) (logical or) and C(&) (logical and).
+ - Flags supported by Hetzner are V(syn), V(fin), V(rst), V(psh) and V(urg).
+ - They can be combined with V(|) (logical or) and V(&) (logical and).
- See L(the documentation,https://wiki.hetzner.de/index.php/Robot_Firewall/en#Parameter)
for more information.
type: str
@@ -230,7 +236,8 @@ EXAMPLES = r'''
allowlist_hos: true
rules:
input:
- - name: Allow ICMP protocol, so you can ping your server
+ - name: Allow ICMP protocol
+ # This is needed so you can ping your server
ip_version: ipv4
protocol: icmp
action: accept
@@ -241,7 +248,8 @@ EXAMPLES = r'''
dst_port: '32768-65535'
tcp_flags: ack
action: accept
- - name: Allow everything to ports 20-23 from 4.3.2.1/24 (IPv4 only)
+ - name: Allow restricted access from some known IPv4 addresses
+ # Allow everything to ports 20-23 from 4.3.2.1/24 (IPv4 only)
ip_version: ipv4
src_ip: 4.3.2.1/24
dst_port: '20-23'
@@ -270,7 +278,7 @@ firewall:
port:
description:
- Switch port of firewall.
- - C(main) or C(kvm).
+ - V(main) or V(kvm).
type: str
sample: main
server_ip:
@@ -286,9 +294,9 @@ firewall:
status:
description:
- Status of the firewall.
- - C(active) or C(disabled).
- - Will be C(in process) if the firewall is currently updated, and
- I(wait_for_configured) is set to C(false) or I(timeout) to a too small value.
+ - V(active) or V(disabled).
+ - Will be V(in process) if the firewall is currently updated, and
+ O(wait_for_configured) is set to V(false) or O(timeout) to a too small value.
type: str
sample: active
allowlist_hos:
@@ -300,7 +308,7 @@ firewall:
whitelist_hos:
description:
- Whether Hetzner services have access.
- - Old name of return value C(allowlist_hos), will be removed eventually.
+ - Old name of return value V(allowlist_hos), will be removed eventually.
type: bool
sample: true
rules:
@@ -360,7 +368,7 @@ firewall:
action:
description:
- Action if rule matches.
- - C(accept) or C(discard).
+ - V(accept) or V(discard).
type: str
sample: accept
choices:
@@ -418,7 +426,7 @@ firewall:
action:
description:
- Action if rule matches.
- - C(accept) or C(discard).
+ - V(accept) or V(discard).
type: str
sample: accept
choices:
diff --git a/ansible_collections/community/hrobot/plugins/modules/firewall_info.py b/ansible_collections/community/hrobot/plugins/modules/firewall_info.py
index 49f98ab64..f72e253d7 100644
--- a/ansible_collections/community/hrobot/plugins/modules/firewall_info.py
+++ b/ansible_collections/community/hrobot/plugins/modules/firewall_info.py
@@ -37,14 +37,14 @@ options:
server_ip:
description:
- The server's main IP address.
- - Exactly one of I(server_ip) and I(server_number) must be specified.
+ - Exactly one of O(server_ip) and O(server_number) must be specified.
- Note that Hetzner deprecated identifying the server's firewall by the server's main IP.
- Using this option can thus stop working at any time in the future. Use I(server_number) instead.
+ Using this option can thus stop working at any time in the future. Use O(server_number) instead.
type: str
server_number:
description:
- The server's number.
- - Exactly one of I(server_ip) and I(server_number) must be specified.
+ - Exactly one of O(server_ip) and O(server_number) must be specified.
type: int
version_added: 1.8.0
wait_for_configured:
@@ -94,7 +94,7 @@ firewall:
port:
description:
- Switch port of firewall.
- - C(main) or C(kvm).
+ - V(main) or V(kvm).
type: str
sample: main
filter_ipv6:
@@ -115,9 +115,9 @@ firewall:
status:
description:
- Status of the firewall.
- - C(active) or C(disabled).
- - Will be C(in process) if the firewall is currently updated, and
- I(wait_for_configured) is set to C(false) or I(timeout) to a too small value.
+ - V(active) or V(disabled).
+ - Will be V(in process) if the firewall is currently updated, and
+ O(wait_for_configured) is set to V(false) or O(timeout) to a too small value.
type: str
sample: active
allowlist_hos:
@@ -129,7 +129,7 @@ firewall:
whitelist_hos:
description:
- Whether Hetzner services have access.
- - Old name of return value C(allowlist_hos), will be removed eventually.
+ - Old name of return value V(allowlist_hos), will be removed eventually.
type: bool
sample: true
rules:
@@ -189,7 +189,7 @@ firewall:
action:
description:
- Action if rule matches.
- - C(accept) or C(discard).
+ - V(accept) or V(discard).
type: str
sample: accept
choices:
@@ -247,7 +247,7 @@ firewall:
action:
description:
- Action if rule matches.
- - C(accept) or C(discard).
+ - V(accept) or V(discard).
type: str
sample: accept
choices:
diff --git a/ansible_collections/community/hrobot/plugins/modules/reset.py b/ansible_collections/community/hrobot/plugins/modules/reset.py
index d367936e0..eaeaa5853 100644
--- a/ansible_collections/community/hrobot/plugins/modules/reset.py
+++ b/ansible_collections/community/hrobot/plugins/modules/reset.py
@@ -40,11 +40,11 @@ options:
reset_type:
description:
- How to reset the server.
- - C(software) is a software reset. This should be similar to pressing Ctrl+Alt+Del on the keyboard.
- - C(power) is a hardware reset similar to pressing the Power button. An ACPI signal is sent, and if the
+ - V(software) is a software reset. This should be similar to pressing Ctrl+Alt+Del on the keyboard.
+ - V(power) is a hardware reset similar to pressing the Power button. An ACPI signal is sent, and if the
server is configured correctly, this will trigger a regular shutdown.
- - C(hardware) is a hardware reset similar to pressing the Restart button. The power is cycled for the server.
- - C(manual) is a manual reset. This requests a technician to manually do the shutdown while looking at the
+ - V(hardware) is a hardware reset similar to pressing the Restart button. The power is cycled for the server.
+ - V(manual) is a manual reset. This requests a technician to manually do the shutdown while looking at the
screen output. B(Be careful) and only use this when really necessary!
- Note that not every server supports every reset method!
type: str
diff --git a/ansible_collections/community/hrobot/plugins/modules/reverse_dns.py b/ansible_collections/community/hrobot/plugins/modules/reverse_dns.py
index 200489217..f3a914679 100644
--- a/ansible_collections/community/hrobot/plugins/modules/reverse_dns.py
+++ b/ansible_collections/community/hrobot/plugins/modules/reverse_dns.py
@@ -44,7 +44,7 @@ options:
required: true
state:
description:
- - Whether to set or update (C(present)) or delete (C(absent)) the reverse DNS entry for I(ip).
+ - Whether to set or update (V(present)) or delete (V(absent)) the reverse DNS entry for O(ip).
type: str
default: present
choices:
@@ -52,8 +52,8 @@ options:
- absent
value:
description:
- - The reverse DNS entry for I(ip).
- - Required if I(state=present).
+ - The reverse DNS entry for O(ip).
+ - Required if O(state=present).
type: str
'''
diff --git a/ansible_collections/community/hrobot/plugins/modules/server.py b/ansible_collections/community/hrobot/plugins/modules/server.py
index 2a24986e3..d32320af6 100644
--- a/ansible_collections/community/hrobot/plugins/modules/server.py
+++ b/ansible_collections/community/hrobot/plugins/modules/server.py
@@ -100,7 +100,7 @@ server:
traffic:
description:
- Free traffic quota.
- - C(unlimited) in case of unlimited traffic.
+ - V(unlimited) in case of unlimited traffic.
type: str
sample: 5 TB
returned: success
diff --git a/ansible_collections/community/hrobot/plugins/modules/server_info.py b/ansible_collections/community/hrobot/plugins/modules/server_info.py
index b3f6da11d..eed9f2289 100644
--- a/ansible_collections/community/hrobot/plugins/modules/server_info.py
+++ b/ansible_collections/community/hrobot/plugins/modules/server_info.py
@@ -40,9 +40,9 @@ options:
full_info:
description:
- Whether to provide full information for every server.
- - Setting this to C(true) requires one REST call per server,
+ - Setting this to V(true) requires one REST call per server,
which is slow and reduces your rate limit. Use with care.
- - When I(server_number) is specified, this option is set to C(true).
+ - When O(server_number) is specified, this option is set to V(true).
type: bool
default: false
'''
@@ -113,7 +113,7 @@ servers:
traffic:
description:
- Free traffic quota.
- - C(unlimited) in case of unlimited traffic.
+ - V(unlimited) in case of unlimited traffic.
type: str
sample: 5 TB
returned: success
@@ -171,55 +171,55 @@ servers:
- Whether the server can be automatically reset.
type: bool
sample: true
- returned: when I(full_info=true)
+ returned: when O(full_info=true)
rescue:
description:
- Whether the rescue system is available.
type: bool
sample: false
- returned: when I(full_info=true)
+ returned: when O(full_info=true)
vnc:
description:
- Flag of VNC installation availability.
type: bool
sample: true
- returned: when I(full_info=true)
+ returned: when O(full_info=true)
windows:
description:
- Flag of Windows installation availability.
type: bool
sample: true
- returned: when I(full_info=true)
+ returned: when O(full_info=true)
plesk:
description:
- Flag of Plesk installation availability.
type: bool
sample: true
- returned: when I(full_info=true)
+ returned: when O(full_info=true)
cpanel:
description:
- Flag of cPanel installation availability.
type: bool
sample: true
- returned: when I(full_info=true)
+ returned: when O(full_info=true)
wol:
description:
- Flag of Wake On Lan availability.
type: bool
sample: true
- returned: when I(full_info=true)
+ returned: when O(full_info=true)
hot_swap:
description:
- Flag of Hot Swap availability.
type: bool
sample: true
- returned: when I(full_info=true)
+ returned: when O(full_info=true)
linked_storagebox:
description:
- Linked Storage Box ID.
type: int
sample: 12345
- returned: when I(full_info=true)
+ returned: when O(full_info=true)
'''
from ansible.module_utils.basic import AnsibleModule
diff --git a/ansible_collections/community/hrobot/plugins/modules/ssh_key.py b/ansible_collections/community/hrobot/plugins/modules/ssh_key.py
index 2353514b9..e2064592c 100644
--- a/ansible_collections/community/hrobot/plugins/modules/ssh_key.py
+++ b/ansible_collections/community/hrobot/plugins/modules/ssh_key.py
@@ -38,9 +38,9 @@ options:
state:
description:
- Whether to make sure a public SSH key is present or absent.
- - C(present) makes sure that the SSH key is available, and
- potentially updates names for existing SHS public keys.
- - C(absent) makes sure that the SSH key is not available.
+ - V(present) makes sure that the SSH key is available, and
+ potentially updates names for existing SSH public keys.
+ - V(absent) makes sure that the SSH key is not available.
The fingerprint or public key data is used for matching the
key.
required: true
@@ -51,19 +51,19 @@ options:
name:
description:
- The public key's name.
- - Required if I(state=present), and ignored if I(state=absent).
+ - Required if O(state=present), and ignored if O(state=absent).
type: str
fingerprint:
description:
- The MD5 fingerprint of the public SSH key to remove.
- - One of I(public_key) and I(fingerprint) are required if I(state=absent).
+ - One of O(public_key) and O(fingerprint) are required if O(state=absent).
type: str
public_key:
description:
- The public key data in OpenSSH format.
- - "Example: C(ssh-rsa AAAAB3NzaC1yc+...)"
- - One of I(public_key) and I(fingerprint) are required if I(state=absent).
- - Required if I(state=present).
+ - "Example: V(ssh-rsa AAAAB3NzaC1yc+...)"
+ - One of O(public_key) and O(fingerprint) are required if O(state=absent).
+ - Required if O(state=present).
type: str
'''
diff --git a/ansible_collections/community/hrobot/plugins/modules/v_switch.py b/ansible_collections/community/hrobot/plugins/modules/v_switch.py
index 6035392a4..f4ab27a11 100644
--- a/ansible_collections/community/hrobot/plugins/modules/v_switch.py
+++ b/ansible_collections/community/hrobot/plugins/modules/v_switch.py
@@ -51,9 +51,9 @@ options:
state:
description:
- State of the vSwitch.
- - vSwitch is created if state is C(present), and deleted if state is C(absent).
- - C(absent) just cancels the vSwitch at the end of the current day.
- - When cancelling, you have to specify I(servers=[]) if you want to actively remove the servers in the vSwitch.
+ - vSwitch is created if state is V(present), and deleted if state is V(absent).
+ - V(absent) just cancels the vSwitch at the end of the current day.
+ - When cancelling, you have to specify O(servers=[]) if you want to actively remove the servers in the vSwitch.
type: str
default: present
choices: [ present, absent ]