Started working with Ansible. Added some playbooks.

This commit is contained in:
Max Buz
2024-03-05 13:34:41 +01:00
committed by GitHub
commit 1de07cddb6
2 changed files with 30 additions and 0 deletions

16
zabbix_agent_upgrade.yml Normal file
View File

@@ -0,0 +1,16 @@
- name: Upgrade zabbix agent
hosts: zagents
become: true
tasks:
- name: Ensure that Zabbix agent is at the latest version
ansible.builtin.apt:
name: zabbix-agent2
state: latest
register: zabbix_agent2_status
- name: Upgrade Zabbix agent if not latest
ansible.builtin.apt:
name: zabbix-agent2
upgrade: yes
when: zabbix_agent2_status.changed