42 lines
946 B
YAML
42 lines
946 B
YAML
|
|
- name: Install zabbix related packages
|
||
|
|
ansible.builtin.apt:
|
||
|
|
pkg:
|
||
|
|
- zabbix-agent2
|
||
|
|
# To monitor our physical disks health, not needed for vm's.
|
||
|
|
- smartmontools
|
||
|
|
|
||
|
|
- name: Zabbix firewall
|
||
|
|
ansible.builtin.template:
|
||
|
|
dest: /etc/firewall.d/zabbix
|
||
|
|
group: root
|
||
|
|
owner: root
|
||
|
|
mode: "0755"
|
||
|
|
src: zabbix-firewall.j2
|
||
|
|
notify: Restart firewall
|
||
|
|
|
||
|
|
- name: Write psk file
|
||
|
|
ansible.builtin.copy:
|
||
|
|
content: "{{ zabbix_psk }}\n"
|
||
|
|
dest: /etc/zabbix/zabbix.psk
|
||
|
|
group: root
|
||
|
|
owner: root
|
||
|
|
mode: "0644"
|
||
|
|
notify: Restart zabbix-agent2
|
||
|
|
|
||
|
|
- name: Zabbix agent config file
|
||
|
|
ansible.builtin.template:
|
||
|
|
dest: /etc/zabbix/zabbix_agent2.d/ansible.conf
|
||
|
|
group: root
|
||
|
|
owner: root
|
||
|
|
mode: "0644"
|
||
|
|
src: zabbix-agent.j2
|
||
|
|
notify: Restart zabbix-agent2
|
||
|
|
|
||
|
|
- name: Zabbix sudoers file
|
||
|
|
ansible.builtin.copy:
|
||
|
|
dest: /etc/sudoers.d/zabbix
|
||
|
|
group: root
|
||
|
|
owner: root
|
||
|
|
mode: "0644"
|
||
|
|
src: zabbix-sudoers
|