ansible.builtin.zabbix_host (v2.3.3.0-1) — module

Zabbix host creates/updates/deletes

| "added in version" 2.0 of ansible.builtin"

Authors: (@cove), Tony Minfei Ding, Harrison Gu (@harrisongu)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.3.3.0.post1

Description

This module allows you to create, modify and delete Zabbix host entries and associated group and template data.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a new host or update an existing host's info
  local_action:
    module: zabbix_host
    server_url: http://monitor.example.com
    login_user: username
    login_password: password
    host_name: ExampleHost
    visible_name: ExampleName
    host_groups:
      - Example group1
      - Example group2
    link_templates:
      - Example template1
      - Example template2
    status: enabled
    state: present
    inventory_mode: automatic
    interfaces:
      - type: 1
        main: 1
        useip: 1
        ip: 10.xx.xx.xx
        dns: ""
        port: 10050
      - type: 4
        main: 1
        useip: 1
        ip: 10.xx.xx.xx
        dns: ""
        port: 12345
    proxy: a.zabbix.proxy

Inputs

    
force:
    choices:
    - 'yes'
    - 'no'
    default: 'yes'
    description:
    - Overwrite the host configuration, even if already present
    required: false
    version_added: '2.0'
    version_added_collection: ansible.builtin

proxy:
    default: None
    description:
    - The name of the Zabbix Proxy to be used

state:
    choices:
    - present
    - absent
    default: present
    description:
    - 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(absent) will remove a host if it exists.
    required: false

status:
    choices:
    - enabled
    - disabled
    default: enabled
    description:
    - Monitoring status of the host.
    required: false

timeout:
    default: 10
    description:
    - The timeout of API request (seconds).

host_name:
    description:
    - Name of the host in Zabbix.
    - host_name is the unique identifier used and cannot be updated using this module.
    required: true

interfaces:
    default: []
    description:
    - List of interfaces to be created for the host (see example below).
    - 'Available values are: dns, ip, main, port, type and useip.'
    - 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
    required: false

login_user:
    description:
    - Zabbix user name, used to authenticate against the server.
    required: true

server_url:
    aliases:
    - url
    description:
    - Url of Zabbix server, with protocol (http or https).
    required: true

host_groups:
    description:
    - List of host groups the host is part of.
    required: false

visible_name:
    description:
    - Visible name of the host in Zabbix.
    required: false
    version_added: '2.3'
    version_added_collection: ansible.builtin

inventory_mode:
    choices:
    - automatic
    - manual
    - disabled
    default: None
    description:
    - Configure the inventory mode.
    required: false
    version_added: '2.1'
    version_added_collection: ansible.builtin

link_templates:
    default: None
    description:
    - List of templates linked to the host.
    required: false

login_password:
    description:
    - Zabbix user password.
    required: true

http_login_user:
    default: None
    description:
    - Basic Auth login
    required: false
    version_added: '2.1'
    version_added_collection: ansible.builtin

http_login_password:
    default: None
    description:
    - Basic Auth password
    required: false
    version_added: '2.1'
    version_added_collection: ansible.builtin