I have read the documentation and install module zabbix-api on host and python version is 2.7…On the ansible server:
ansible 2.4.2.0
config file = /ansible/ansible.cfg
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.6/site-packages/ansible
executable location = /usr/bin/ansible
python version = 2.6.6 (r266:84292, Aug 18 2016, 15:13:37) [GCC 4.4.7 20120313 (Red Hat 4.4.7-17)]
python --version
2.7
my play is
- hosts: zabbix
tasks:
- name: This is installation
zabbix_maintenance:
name: Zabbix123
host_groups: Discovered host,Linux servers
state: present
minutes: 90
server_url: http://[zabbix.patrol.net](http://zabbix.socialpatrol.net/)
login_user: Admin
login_password: yORK
desc: Setting up maintenance window for builds
my issue is that when I try to run ansible-playbook playbook.yaml
I keep getting the error:
TASK [This is installation] **********************************************************
fatal: [zabbix_server]: FAILED! => {"changed": false, "msg": "Missing required zabbix-api module (check docs or install with: pip install zabbix-api)"}
to retry, use: --limit @/ansible/playbook.retry
The full traceback is:
File "/tmp/ansible_XXjWDO/ansible_module_zabbix_maintenance.py", line 164, in <module>
`from zabbix_api import ZabbixAPI
fatal: [zabbix_server]: FAILED! => {
“changed”: false,
“invocation”: {
“module_args”: {
“collect_data”: true,
“desc”: “Setting up maintenance window for builds”,
“host_groups”: [
“Discovered host”,
“Linux servers”
],
“host_names”: null,
“http_login_password”: null,
“http_login_user”: null,
“login_password”: “VALUE_SPECIFIED_IN_NO_LOG_PARAMETER”,
“login_user”: “Admin”,
“minutes”: 90,
“name”: “Zabbix123”,
“server_url”: “http:/l.net”,
“state”: “present”,
“timeout”: 10
}
},
“msg”: “Missing required zabbix-api module (check docs or install with: pip install zabbix-api)”
`