Zabbix host ipmi (#33718)

* Update zabbix_host documentation (extend ipmi_-documentation, and update style to be consistent on the rest while we are at it)

* Remove ipmi_parameters being added to the API call when not required

* remove optional parameters from add_host, as well
This commit is contained in:
Eike Frost 2017-12-11 14:41:35 +01:00 committed by ansibot
parent 33c7a157ab
commit bf8439e2a0

View file

@ -38,12 +38,10 @@ options:
visible_name: visible_name:
description: description:
- Visible name of the host in Zabbix. - Visible name of the host in Zabbix.
required: false
version_added: '2.3' version_added: '2.3'
description: description:
description: description:
- Description of the host in Zabbix. - Description of the host in Zabbix.
required: false
version_added: '2.5' version_added: '2.5'
host_groups: host_groups:
description: description:
@ -52,37 +50,30 @@ options:
link_templates: link_templates:
description: description:
- List of templates linked to the host. - List of templates linked to the host.
required: false
default: None default: None
inventory_mode: inventory_mode:
description: description:
- Configure the inventory mode. - Configure the inventory mode.
choices: ['automatic', 'manual', 'disabled'] choices: ['automatic', 'manual', 'disabled']
required: false
default: None
version_added: '2.1' version_added: '2.1'
inventory_zabbix: inventory_zabbix:
description: description:
- Add Facts for a zabbix inventory (e.g. Tag) (see example below). - Add Facts for a zabbix inventory (e.g. Tag) (see example below).
- Please review the interface documentation for more information on the supported properties - Please review the interface documentation for more information on the supported properties
- 'https://www.zabbix.com/documentation/3.2/manual/api/reference/host/object#host_inventory' - 'https://www.zabbix.com/documentation/3.2/manual/api/reference/host/object#host_inventory'
required: false
default: None
version_added: '2.5' version_added: '2.5'
status: status:
description: description:
- Monitoring status of the host. - Monitoring status of the host.
required: false
choices: ['enabled', 'disabled'] choices: ['enabled', 'disabled']
default: "enabled" default: 'enabled'
state: state:
description: description:
- State of the host. - State of the host.
- On C(present), it will create if host does not exist or update the host if the associated data is different. - On C(present), it will create if host does not exist or update the host if the associated data is different.
- On C(absent) will remove a host if it exists. - On C(absent) will remove a host if it exists.
required: false
choices: ['present', 'absent'] choices: ['present', 'absent']
default: "present" default: 'present'
proxy: proxy:
description: description:
- The name of the Zabbix Proxy to be used - The name of the Zabbix Proxy to be used
@ -93,7 +84,6 @@ options:
- 'Available values are: dns, ip, main, port, type and useip.' - 'Available values are: dns, ip, main, port, type and useip.'
- Please review the interface documentation for more information on the supported properties - Please review the interface documentation for more information on the supported properties
- 'https://www.zabbix.com/documentation/2.0/manual/appendix/api/hostinterface/definitions#host_interface' - 'https://www.zabbix.com/documentation/2.0/manual/appendix/api/hostinterface/definitions#host_interface'
required: false
default: [] default: []
tls_connect: tls_connect:
description: description:
@ -103,7 +93,7 @@ options:
- Values can be combined. - Values can be combined.
- Works only with >= Zabbix 3.0 - Works only with >= Zabbix 3.0
default: 1 default: 1
version_added: "2.5" version_added: '2.5'
tls_accept: tls_accept:
description: description:
- Specifies what types of connections are allowed for incoming connections. - Specifies what types of connections are allowed for incoming connections.
@ -112,70 +102,65 @@ options:
- Values can be combined. - Values can be combined.
- Works only with >= Zabbix 3.0 - Works only with >= Zabbix 3.0
default: 1 default: 1
version_added: "2.5" version_added: '2.5'
tls_psk_identity: tls_psk_identity:
description: description:
- PSK value is a hard to guess string of hexadecimal digits. - PSK value is a hard to guess string of hexadecimal digits.
- It is a unique name by which this specific PSK is referred to by Zabbix components - It is a unique name by which this specific PSK is referred to by Zabbix components
- Do not put sensitive information in PSK identity string, it is transmitted over the network unencrypted. - Do not put sensitive information in PSK identity string, it is transmitted over the network unencrypted.
- Works only with >= Zabbix 3.0 - Works only with >= Zabbix 3.0
required: false version_added: '2.5'
version_added: "2.5"
tls_psk: tls_psk:
description: description:
- The preshared key, at least 32 hex digits. Required if either tls_connect or tls_accept has PSK enabled. - The preshared key, at least 32 hex digits. Required if either tls_connect or tls_accept has PSK enabled.
- Works only with >= Zabbix 3.0 - Works only with >= Zabbix 3.0
required: false version_added: '2.5'
version_added: "2.5"
tls_issuer: tls_issuer:
description: description:
- Required certificate issuer. - Required certificate issuer.
- Works only with >= Zabbix 3.0 - Works only with >= Zabbix 3.0
required: false version_added: '2.5'
version_added: "2.5"
tls_subject: tls_subject:
description: description:
- Required certificate subject. - Required certificate subject.
- Works only with >= Zabbix 3.0 - Works only with >= Zabbix 3.0
required: false version_added: '2.5'
version_added: "2.5"
ipmi_authtype: ipmi_authtype:
description: description:
- IPMI authentication algorithm. - IPMI authentication algorithm.
- Please review the Host object documentation for more information on the supported properties - Please review the Host object documentation for more information on the supported properties
- 'https://www.zabbix.com/documentation/3.4/manual/api/reference/host/object' - 'https://www.zabbix.com/documentation/3.4/manual/api/reference/host/object'
- Possible values are, 0 (none), 1 (MD2), 2 (MD5), 4 (straight), 5 (OEM), 6 (RMCP+). - Possible values are, C(0) (none), C(1) (MD2), C(2) (MD5), C(4) (straight), C(5) (OEM), C(6) (RMCP+),
default: None with -1 being the API default.
required: false - Please note that the Zabbix API will treat absent settings as default when updating
version_added: "2.5" any of the I(ipmi_)-options; this means that if you attempt to set any of the four
options individually, the rest will be reset to default values.
version_added: '2.5'
ipmi_privilege: ipmi_privilege:
description: description:
- IPMI privilege level. - IPMI privilege level.
- Please review the Host object documentation for more information on the supported properties - Please review the Host object documentation for more information on the supported properties
- 'https://www.zabbix.com/documentation/3.4/manual/api/reference/host/object' - 'https://www.zabbix.com/documentation/3.4/manual/api/reference/host/object'
- Possible values are, 1 (callback), 2 (user), 3 (operator), 4 (admin), 5 (OEM). - Possible values are C(1) (callback), C(2) (user), C(3) (operator), C(4) (admin), C(5) (OEM), with C(2)
default: None being the API default.
required: false - also see the last note in the I(ipmi_authtype) documentation
version_added: "2.5" version_added: '2.5'
ipmi_username: ipmi_username:
description: description:
- IPMI username. - IPMI username.
default: None - also see the last note in the I(ipmi_authtype) documentation
required: false version_added: '2.5'
version_added: "2.5"
ipmi_password: ipmi_password:
description: description:
- IPMI password. - IPMI password.
default: None - also see the last note in the I(ipmi_authtype) documentation
required: false version_added: '2.5'
version_added: "2.5"
force: force:
description: description:
- Overwrite the host configuration, even if already present - Overwrite the host configuration, even if already present
required: false default: 'yes'
default: "yes" choices: [ 'yes', 'no' ]
choices: [ "yes", "no" ] version_added: '2.0'
version_added: "2.0"
extends_documentation_fragment: extends_documentation_fragment:
- zabbix - zabbix
''' '''
@ -301,9 +286,7 @@ class Host(object):
if self._module.check_mode: if self._module.check_mode:
self._module.exit_json(changed=True) self._module.exit_json(changed=True)
parameters = {'host': host_name, 'interfaces': interfaces, 'groups': group_ids, 'status': status, parameters = {'host': host_name, 'interfaces': interfaces, 'groups': group_ids, 'status': status,
'tls_connect': tls_connect, 'tls_accept': tls_accept, 'ipmi_authtype': ipmi_authtype, 'tls_connect': tls_connect, 'tls_accept': tls_accept}
'ipmi_privilege': ipmi_privilege, 'ipmi_username': ipmi_username,
'ipmi_password': ipmi_password}
if proxy_id: if proxy_id:
parameters['proxy_hostid'] = proxy_id parameters['proxy_hostid'] = proxy_id
if visible_name: if visible_name:
@ -340,8 +323,7 @@ class Host(object):
if self._module.check_mode: if self._module.check_mode:
self._module.exit_json(changed=True) self._module.exit_json(changed=True)
parameters = {'hostid': host_id, 'groups': group_ids, 'status': status, 'tls_connect': tls_connect, parameters = {'hostid': host_id, 'groups': group_ids, 'status': status, 'tls_connect': tls_connect,
'tls_accept': tls_accept, 'ipmi_authtype': ipmi_authtype, 'ipmi_privilege': ipmi_privilege, 'tls_accept': tls_accept}
'ipmi_username': ipmi_username, 'ipmi_password': ipmi_password}
if proxy_id >= 0: if proxy_id >= 0:
parameters['proxy_hostid'] = proxy_id parameters['proxy_hostid'] = proxy_id
if visible_name: if visible_name: