main.yml 755 B

1234567891011121314151617181920212223
  1. - name: Create elasticsearch scripts directory
  2. file:
  3. path: /etc/zabbix/scripts/elasticsearch
  4. state: directory
  5. mode: 0700
  6. - name: Push elasticsearch monitoring scripts
  7. synchronize: src="items" dest="/tmp/"
  8. - name: Install monitoring scripts
  9. 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"
  10. - name: Install python modules
  11. shell: "cd /etc/zabbix/ && python get-pip.py"
  12. - name: Install elasticsearch module
  13. pip: name=elasticsearch
  14. - name: Removing temporary directories
  15. shell: "rm -f /etc/zabbix/get-pip.py && rm -rf /tmp/items"
  16. - name: Restart zabbix-agent
  17. service: name=zabbix-agent state=restarted