W3cubDocs

/Ansible

zabbix_hostmacro - Zabbix host macro creates/updates/deletes

New in version 2.0.

Synopsis

  • manages Zabbix host macros, it can create, update or delete them.

Requirements (on host that executes module)

  • python >= 2.6
  • zabbix-api

Options

parameter required default choices comments
host_name
yes
Name of the host.
http_login_password
(added in 2.1)
no None
Basic Auth password
http_login_user
(added in 2.1)
no None
Basic Auth login
login_password
yes
Zabbix user password.
login_user
yes
Zabbix user name.
macro_name
yes
Name of the host macro.
macro_value
yes
Value of the host macro.
server_url
yes
Url of Zabbix server, with protocol (http or https).
aliases: url
state
no present
  • present
  • absent
State of the macro.
On present, it will create if macro does not exist or update the macro if the associated data is different.
On absent will remove a macro if it exists.
timeout
no 10
The timeout of API request (seconds).

Examples

- name: Create a new host macro or update an existing macro's value
  local_action:
    module: zabbix_hostmacro
    server_url: http://monitor.example.com
    login_user: username
    login_password: password
    host_name: ExampleHost
    macro_name: Example macro
    macro_value: Example value
    state: present

Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.

© 2012–2017 Michael DeHaan
© 2017 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/zabbix_hostmacro_module.html