Playbooks to a new Lilik
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

46 lines
1.0 KiB

---
- name: 'install monitoring agent requirements'
apt:
pkg: 'monitoring-plugins-basic'
state: 'present'
update_cache: true
cache_valid_time: 3600
tags:
- 'packages'
- name: 'add monitoring plugin - check_mem.pl'
copy:
src: 'check_mem.pl'
dest: '/usr/lib/nagios/plugins/check_mem.pl'
mode: '0755'
- name: 'create monitoring user'
user:
name: 'icinga'
state: 'present'
tags:
- 'monitoring'
- name: 'create monitoring entry'
set_fact:
agent_monitoring_entry: >
{{ {
host_fqdn: {
'address': ansible_host,
'agent_type': 'ssh',
}
} }}
tags:
- 'monitoring'
- name: 'update monitoring facts'
set_fact:
monitoring_facts: >
{{ hostvars[monitoring_host]['monitoring_facts']
| default({})
| combine(agent_monitoring_entry, recursive=true) }}
delegate_facts: true
delegate_to: '{{ monitoring_host }}'
tags:
- 'monitoring'
...