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.
 
 
 
 

40 lines
881 B

---
- name: 'install monitoring agent requirements'
apt:
pkg: 'monitoring-plugins-basic'
state: 'present'
update_cache: true
cache_valid_time: 3600
tags:
- 'packages'
- 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'
...