dj-wasabi / ansible-zabbix-agent

Installing and maintaining zabbix-agent for RedHat/Debian/Ubuntu/Windows/Suse.
https://galaxy.ansible.com/dj-wasabi/zabbix-agent
MIT License
327 stars 249 forks source link

create host at zabbix issue #67

Closed grzesart1978 closed 7 years ago

grzesart1978 commented 7 years ago

Hi,

I have problem with create host at zabbix after using useip: "{{ zabbix_useuip }}" I get info variable that is undefined The error was: [{u'ip': u'{{ agent_ip }}', u'useip': u'{{ zabbix_useuip }}', u'dns': u'{{ ansible_fqdn }}' problem exist on centos 7 and centos 6.8. Could you help me I don't know what I doing wrong?

ansible 2.2.2 my playbook looks like that

hosts: all roles: role: dj-wasabi.zabbix-agent agent_server: 192.168.33.30 agent_serveractive: 192.168.33.30 zabbix_url: http://zabbix.example.com zabbix_api_use: true # use zabbix_api_create_host and/or zabbix_api_create_hostgroup from 0.8.0 zabbix_api_user: Admin zabbix_api_pass: zabbix zabbix_create_host: present zabbix_host_groups: Linux Servers zabbix_link_templates: Template OS Linux agent_interfaces: type: 1 main: 1 useip: "{{ zabbix_useuip }}" ip: "{{ agent_ip }}" dns: "{{ ansible_fqdn }}" port: "{{ agent_listenport }}" Best Grzegorz

grzesart1978 commented 7 years ago

Hi,

All works fine, sorry my mistake.

agent_ip: "{{ hostvars[inventory_hostname]['ansible_default_ipv4'].address }}"

Best Grzegorz