vn-ansible/roles/config-zabbix-agent/tasks/main.yaml

55 lines
1.7 KiB
YAML

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Install and configure ZABBIX AGENT
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Paso1
# Download zabbix repository
#- name: Download deb package
# get_url:
# url: "{{ deb_url }}"
# dest: /tmp/"{{ deb_package_repo }}"
# Copiar el fichero deb
- name: copy zabbix deb
copy:
src: "{{deb_package_repo}}"
dest: /tmp/{{deb_package_repo}}
owner: root
group: root
mode: '0644'
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Paso2
# Install zabbix repository
- name: Install zabbix repository
apt:
deb: /tmp/{{ deb_package_repo }}
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Paso3
# Delete deb package from tmp
- name: Delete deb package from tmp
file:
path: /tmp/{{ deb_package_repo }}
state: absent
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Paso4
# update packages
- name: update packages
apt:
name: "*"
state: latest
update_cache: true
force_apt_get: true
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Install zabbix agent
- name: Install zabbix agent
apt:
name: "{{ zabbix_package }}"
state: present
notify: restart zabbix-agent
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# service should start on boot.
- name: service should start on boot
service:
name: "{{ zabbix_agent_daemon }}"
enabled: yes
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++