mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Implemented freezer for docker
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
- name: "restart system-maintenance-service-freeze.service"
|
||||
- name: "reload system-maintenance-service-freeze.service"
|
||||
systemd:
|
||||
name: system-maintenance-service-freeze.service
|
||||
daemon_reload: yes
|
||||
|
||||
- name: "restart system-maintenance-service-defrost.service"
|
||||
- name: "reload system-maintenance-service-defrost.service"
|
||||
systemd:
|
||||
name: system-maintenance-service-defrost.service
|
||||
daemon_reload: yes
|
@@ -3,6 +3,7 @@
|
||||
copy:
|
||||
src: system-maintenance-service-freezer.py
|
||||
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
|
||||
loop:
|
||||
@@ -11,10 +12,22 @@
|
||||
template:
|
||||
src: system-maintenance-service-freezer.service.j2
|
||||
dest: "/etc/systemd/system/system-maintenance-service-{{ item }}.service"
|
||||
notify: "restart system-maintenance-service-{{ item }} service"
|
||||
when: run_once_systemd_freezer is not defined
|
||||
notify: "reload system-maintenance-service-{{ item }} service"
|
||||
when: run_once_system_maintenance_service_freeze is not defined
|
||||
|
||||
- name: run the system_maintenance_service_freezer tasks once
|
||||
set_fact:
|
||||
run_once_systemd_freezer: true
|
||||
when: run_once_systemd_freezer is not defined
|
||||
run_once_system_maintenance_service_freeze: true
|
||||
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}}"
|
Reference in New Issue
Block a user