2020-04-17 18:50:14 +02:00
|
|
|
---
|
|
|
|
- name: Repository and packages, deb/ubuntu
|
|
|
|
block:
|
|
|
|
- name: Install the repository
|
2020-04-20 15:13:49 +02:00
|
|
|
apt: deb={{ zabbix_agent_ubuntu_repo }} state=present
|
2020-04-17 18:50:14 +02:00
|
|
|
register: update_apt_cache
|
2020-04-20 15:13:49 +02:00
|
|
|
when: "'zabbix-release' not in ansible_facts.packages"
|
2020-04-17 18:50:14 +02:00
|
|
|
|
|
|
|
- name: Update the apt cache if we just installed the repository
|
|
|
|
apt: update_cache=yes
|
2020-04-20 15:13:49 +02:00
|
|
|
when: update_apt_cache is defined and update_apt_cache is changed
|
2020-04-17 18:50:14 +02:00
|
|
|
|
|
|
|
- name: Install the Zabbix agent package
|
2020-04-20 15:13:49 +02:00
|
|
|
apt: pkg={{ zabbix_agent_packages }} state=latest cache_valid_time=1800
|
2020-04-17 18:50:14 +02:00
|
|
|
|
|
|
|
tags: [ 'zabbix', 'zabbix_agent' ]
|