Initialise repository structure and placeholder files. Generic functionality works i guess, need to come up with a better solution for compose templates
This commit is contained in:
commit
53695f4fff
411 files changed
+7817
No files matched your search
@@ -0,0 +1,8 @@
|
||||
# monitoring
|
||||
|
||||
Abstract monitoring hook for installing a replaceable agent. Set
|
||||
`monitoring_agent`, `monitoring_packages`, `monitoring_services`, and optional
|
||||
template mappings in inventory.
|
||||
|
||||
Tags: `monitoring`, `config`, `services`.
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
monitoring_agent: none
|
||||
monitoring_packages: []
|
||||
monitoring_services: []
|
||||
monitoring_config_files: []
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
- name: restart monitoring services
|
||||
ansible.builtin.service:
|
||||
name: "{{ item }}"
|
||||
state: restarted
|
||||
loop: "{{ monitoring_services }}"
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
---
|
||||
- name: Install monitoring packages
|
||||
ansible.builtin.apt:
|
||||
name: "{{ monitoring_packages }}"
|
||||
state: present
|
||||
update_cache: true
|
||||
when: monitoring_agent != "none"
|
||||
tags: [monitoring]
|
||||
|
||||
- name: Deploy monitoring configuration files
|
||||
ansible.builtin.template:
|
||||
src: "{{ item.template }}"
|
||||
dest: "{{ item.dest }}"
|
||||
owner: "{{ item.owner | default('root') }}"
|
||||
group: "{{ item.group | default('root') }}"
|
||||
mode: "{{ item.mode | default('0644') }}"
|
||||
loop: "{{ monitoring_config_files }}"
|
||||
when: monitoring_agent != "none"
|
||||
notify: restart monitoring services
|
||||
tags: [monitoring, config]
|
||||
|
||||
- name: Enable monitoring services
|
||||
ansible.builtin.service:
|
||||
name: "{{ item }}"
|
||||
enabled: true
|
||||
state: started
|
||||
loop: "{{ monitoring_services }}"
|
||||
when: monitoring_agent != "none"
|
||||
tags: [monitoring, services]
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
Reference in new issue
Block a user