mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2024-11-22 04:31:13 +01:00
Implemented freezer for docker
This commit is contained in:
parent
8c89d08980
commit
1ad6c6110a
8
destructor.yml
Normal file
8
destructor.yml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
- name: call destructor method
|
||||||
|
hosts: all
|
||||||
|
become: true
|
||||||
|
roles:
|
||||||
|
- role: system-maintenance-service-freezer
|
||||||
|
vars:
|
||||||
|
system_maintenance_service_freeze_action: "defrost"
|
@ -100,4 +100,6 @@
|
|||||||
hosts: msi_perkeyrgb
|
hosts: msi_perkeyrgb
|
||||||
become: true
|
become: true
|
||||||
roles:
|
roles:
|
||||||
- driver-msi-keyboard-color
|
- driver-msi-keyboard-color
|
||||||
|
|
||||||
|
- import_playbook: destructor.yml
|
@ -79,6 +79,8 @@ system_maintenance_services:
|
|||||||
- "heal-docker"
|
- "heal-docker"
|
||||||
- "update-docker"
|
- "update-docker"
|
||||||
|
|
||||||
|
system_maintenance_service_freeze_action: 'freeze' # Valid Values: freeze, defrost
|
||||||
|
|
||||||
# Routings
|
# Routings
|
||||||
redirect_domain_mappings:
|
redirect_domain_mappings:
|
||||||
- { source: "nextcloud.{{top_domain}}", target: "cloud.{{top_domain}}" }
|
- { source: "nextcloud.{{top_domain}}", target: "cloud.{{top_domain}}" }
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
---
|
---
|
||||||
dependencies:
|
dependencies:
|
||||||
- role: cleanup-backups-service
|
- role: cleanup-backups-service
|
||||||
|
- role: system-maintenance-service-freezer
|
||||||
|
@ -2,4 +2,5 @@ dependencies:
|
|||||||
- git
|
- git
|
||||||
- backups-provider
|
- backups-provider
|
||||||
- systemd-notifier
|
- systemd-notifier
|
||||||
- cleanup-failed-docker-backups
|
- cleanup-failed-docker-backups
|
||||||
|
- system-maintenance-service-freezer
|
@ -3,3 +3,4 @@ dependencies:
|
|||||||
- systemd-notifier
|
- systemd-notifier
|
||||||
- cleanup-backups-timer
|
- cleanup-backups-timer
|
||||||
- cleanup-failed-docker-backups
|
- cleanup-failed-docker-backups
|
||||||
|
- system-maintenance-service-freezer
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
- python-pip
|
- python-pip
|
||||||
- systemd-notifier
|
- systemd-notifier
|
||||||
|
- system-maintenance-service-freezer
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
- systemd-notifier
|
- systemd-notifier
|
||||||
|
- system-maintenance-service-freezer
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
- git
|
- git
|
||||||
- systemd-notifier
|
- systemd-notifier
|
||||||
|
- system-maintenance-service-freezer
|
||||||
|
2
roles/heal-docker/meta/main.yml
Normal file
2
roles/heal-docker/meta/main.yml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
dependencies:
|
||||||
|
- system-maintenance-service-freezer
|
@ -1,9 +1,9 @@
|
|||||||
- name: "restart system-maintenance-service-freeze.service"
|
- name: "reload system-maintenance-service-freeze.service"
|
||||||
systemd:
|
systemd:
|
||||||
name: system-maintenance-service-freeze.service
|
name: system-maintenance-service-freeze.service
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
|
|
||||||
- name: "restart system-maintenance-service-defrost.service"
|
- name: "reload system-maintenance-service-defrost.service"
|
||||||
systemd:
|
systemd:
|
||||||
name: system-maintenance-service-defrost.service
|
name: system-maintenance-service-defrost.service
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
@ -3,6 +3,7 @@
|
|||||||
copy:
|
copy:
|
||||||
src: system-maintenance-service-freezer.py
|
src: system-maintenance-service-freezer.py
|
||||||
dest: "{{path_system_maintenance_service_freezer_script}}"
|
dest: "{{path_system_maintenance_service_freezer_script}}"
|
||||||
|
when: run_once_system_maintenance_service_freeze is not defined
|
||||||
|
|
||||||
- name: Configure system-maintenance-service for each action
|
- name: Configure system-maintenance-service for each action
|
||||||
loop:
|
loop:
|
||||||
@ -11,10 +12,22 @@
|
|||||||
template:
|
template:
|
||||||
src: system-maintenance-service-freezer.service.j2
|
src: system-maintenance-service-freezer.service.j2
|
||||||
dest: "/etc/systemd/system/system-maintenance-service-{{ item }}.service"
|
dest: "/etc/systemd/system/system-maintenance-service-{{ item }}.service"
|
||||||
notify: "restart system-maintenance-service-{{ item }} service"
|
notify: "reload system-maintenance-service-{{ item }} service"
|
||||||
when: run_once_systemd_freezer is not defined
|
when: run_once_system_maintenance_service_freeze is not defined
|
||||||
|
|
||||||
- name: run the system_maintenance_service_freezer tasks once
|
- name: run the system_maintenance_service_freezer tasks once
|
||||||
set_fact:
|
set_fact:
|
||||||
run_once_systemd_freezer: true
|
run_once_system_maintenance_service_freeze: true
|
||||||
when: run_once_systemd_freezer is not defined
|
when: run_once_system_maintenance_service_freeze is not defined
|
||||||
|
|
||||||
|
- name: "restart system-maintenance-service.service"
|
||||||
|
systemd:
|
||||||
|
name: system-maintenance-service-{{system_maintenance_service_freeze_action}}.service
|
||||||
|
state: restart
|
||||||
|
enabled: yes
|
||||||
|
daemon_reload: yes
|
||||||
|
when: maintenance_service_freeze_action_last is not defined or maintenance_service_freeze_action_last != system_maintenance_service_freeze_action
|
||||||
|
|
||||||
|
- name: "set variable to prevent loading when action status didn't change"
|
||||||
|
set_fact:
|
||||||
|
maintenance_service_freeze_action_last: "{{system_maintenance_service_freeze_action}}"
|
2
roles/update-docker/meta/main.yml
Normal file
2
roles/update-docker/meta/main.yml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
dependencies:
|
||||||
|
- system-maintenance-service-freezer
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
- import_playbook: playbook-common.yml
|
- import_playbook: constructor.yml
|
||||||
|
|
||||||
- name: servers host setup
|
- name: servers host setup
|
||||||
hosts: servers
|
hosts: servers
|
||||||
@ -241,3 +241,5 @@
|
|||||||
roles:
|
roles:
|
||||||
- role: nginx-www-redirect
|
- role: nginx-www-redirect
|
||||||
when: nginx_www_redirect | bool
|
when: nginx_www_redirect | bool
|
||||||
|
|
||||||
|
- import_playbook: destructor.yml
|
Loading…
Reference in New Issue
Block a user