commited current state
This commit is contained in:
2
roles/checkmk-monitoring/defaults/main.yaml
Normal file
2
roles/checkmk-monitoring/defaults/main.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
checkmk_agent_plugins_to_remove:
|
||||
- "docker-mailq-monitoring"
|
||||
14
roles/checkmk-monitoring/tasks/cleanup-agent-plugins.yaml
Normal file
14
roles/checkmk-monitoring/tasks/cleanup-agent-plugins.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
- name: "Find and remove specified Checkmk agent plugins"
|
||||
block:
|
||||
- name: "Remove Checkmk agent plugins"
|
||||
ansible.builtin.file:
|
||||
path: "/usr/lib/check_mk_agent/local/{{ item }}"
|
||||
state: absent
|
||||
loop: "{{ checkmk_agent_plugins_to_remove }}"
|
||||
when: checkmk_agent_plugins_to_remove is defined
|
||||
|
||||
- name: "Debug: Removed plugins"
|
||||
ansible.builtin.debug:
|
||||
msg: "Removed plugins: {{ checkmk_agent_plugins_to_remove }}"
|
||||
when: checkmk_agent_plugins_to_remove is defined
|
||||
@@ -4,6 +4,10 @@
|
||||
update_cache: yes
|
||||
notify:
|
||||
- apt cleanup
|
||||
retries: 3
|
||||
delay: 10
|
||||
register: apt_result
|
||||
until: apt_result is succeeded
|
||||
|
||||
- name: Check if a kernel update has been installed
|
||||
shell: |
|
||||
|
||||
@@ -8,4 +8,9 @@
|
||||
state: present
|
||||
snapname: "{{ snapshot_name | default('before_update') }}"
|
||||
retention: 2
|
||||
timeout: 300
|
||||
delegate_to: localhost
|
||||
retries: 3
|
||||
delay: 10
|
||||
register: snapshot_result
|
||||
until: snapshot_result is succeeded
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
vmid: "{{ vmid }}"
|
||||
register: snapshot_info
|
||||
delegate_to: localhost
|
||||
retries: 3
|
||||
delay: 10
|
||||
until: snapshot_info is succeeded
|
||||
|
||||
- name: Delete all snapshots
|
||||
community.proxmox.proxmox_snap:
|
||||
@@ -19,4 +22,8 @@
|
||||
snapname: "{{ item.name }}"
|
||||
loop: "{{ snapshot_info.snapshots }}"
|
||||
when: item.name != "current"
|
||||
delegate_to: localhost
|
||||
delegate_to: localhost
|
||||
retries: 3
|
||||
delay: 10
|
||||
until: item is succeeded
|
||||
timeout: 300
|
||||
@@ -9,6 +9,10 @@
|
||||
config: current
|
||||
register: vm_info
|
||||
delegate_to: localhost
|
||||
retries: 3
|
||||
delay: 10
|
||||
until: vm_info is succeeded
|
||||
timeout: 60
|
||||
|
||||
- name: Extract VMID
|
||||
ansible.builtin.set_fact:
|
||||
|
||||
Reference in New Issue
Block a user