- name: Create elasticsearch scripts directory file: path: /etc/zabbix/scripts/elasticsearch state: directory mode: 0700 - name: Push elasticsearch monitoring scripts synchronize: src="items" dest="/tmp/" - name: Install monitoring scripts shell: "mv /tmp/items/elasticsearch.conf /etc/zabbix/zabbix_agentd.d/ && mv /tmp/items/ESzabbix.py /etc/zabbix/scripts/elasticsearch/ && mv /tmp/items/get-pip.py /etc/zabbix" - name: Install python modules shell: "cd /etc/zabbix/ && python get-pip.py" - name: Install elasticsearch module pip: name=elasticsearch - name: Removing temporary directories shell: "rm -f /etc/zabbix/get-pip.py && rm -rf /tmp/items" - name: Restart zabbix-agent service: name=zabbix-agent state=restarted