install zabbix agent in the baseline
This commit is contained in:
parent
c7a3cb40e9
commit
1df77aa74d
7 changed files with 67 additions and 0 deletions
|
|
@ -7,5 +7,8 @@
|
|||
- name: Manage root user
|
||||
ansible.builtin.import_tasks: rootuser.yml
|
||||
|
||||
- name: Get zabbix agent installed
|
||||
ansible.builtin.import_tasks: zabbix.yml
|
||||
|
||||
- name: Ensure handlers have ran
|
||||
ansible.builtin.meta: flush_handlers
|
||||
|
|
|
|||
41
roles/baseline/tasks/zabbix.yml
Normal file
41
roles/baseline/tasks/zabbix.yml
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
- 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue