Closed kamilkrzeminski closed 7 years ago
The Library
folder is removed a while back, as the modules are now available within Ansible itself.
Are you sure that the provided username and password works correctly? Does the user have enough rights in Zabbix?
Yes, I'm sure that credentials are ok, I event created a temporary user with superadmin rights to rule out misconfiguration issue. Are you sure that your role works fine with Zabbix 3.2? I've noticed that zabbix-api in the newest version (0.4) supports Zabbix<=2.4, so I think that might be a problem.
Hi @kamilkrzeminski
I deleted an host in my environment (CentOS 7, Zabbix 3.2.3) and executed the role and host is created via the API.
TASK [zabbix-agent : Make sure the zabbix-agent service is running] ************
ok: [vserver-209]
TASK [zabbix-agent : Create hostgroups] ****************************************
ok: [vserver-209 -> localhost]
TASK [zabbix-agent : Create a new host or update an existing host's info] ******
changed: [vserver-209 -> localhost]
TASK [zabbix-agent : Updating host configuration with macros] ******************
PLAY RECAP *********************************************************************
vserver-209 : ok=13 changed=1 unreachable=0 failed=0
@dj-wasabi could you please provide your version of Ansible and zabbix-api library?
Yes:
(master) $ pip list | grep -i zabb
zabbix-api (0.4)
Ansible version:
(master) $ ansible --version
ansible 2.2.0.0
config file = /git/ansible/environment/ansible.cfg
configured module search path = ['Library']
Well, it seems that we have exactly the same software versions. I purged my Ansible configuration, purged and reinstalled zabbix-api, and reprovisioned Zabbix Server - and now it works like charm. Seems to be some issue by my side. Apologies for taking your time and thanks for help.
"result": "Successfully added host host02 (172.23.0.24) and linked with template '['Template OS Linux']'"
No worries @kamilkrzeminski Glad to help and enjoy your setup. :-)
I have issue similar to this #31, but now there's no Library folder anymore.
My config is:
My code:
Both group and template exist.