Ansible批量部署zabbix-agent
# cat main.yml- name: scp zabbix 到 client
copy: src=zabbix.tar.gz dest={{ zabbix_home }}
- name: scp zabbix_aegntd 到 client
copy: src=/tmp/zabbix_agentd dest=/etc/init.d/ mode=777
- name: tar zxf zabbix.tar.gz 解压
shell: cd {{ zabbix_home }} && tar -zxf zabbix.tar.gz
- name: Copy zabbix_agent.conf Config file
template: >
src=zabbix_agentd.conf.j2
dest=/usr/local/zabbix/etc/zabbix_agentd.conf
mode=0644 owner=root group=root
- name: restart zabbix
service: name=zabbix_agentd state=restarted
页:
[1]