mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
refactored to timer routine
This commit is contained in:
@@ -1,16 +1,4 @@
|
||||
- name: "reload backup-docker-to-local.service"
|
||||
systemd:
|
||||
name: backup-docker-to-local.service
|
||||
daemon_reload: yes
|
||||
|
||||
- name: "reload backup-docker-to-local-everything.service"
|
||||
systemd:
|
||||
name: backup-docker-to-local-everything.service
|
||||
daemon_reload: yes
|
||||
|
||||
- name: "restart backup-docker-to-local.timer"
|
||||
systemd:
|
||||
name: backup-docker-to-local.timer
|
||||
state: started
|
||||
enabled: yes
|
||||
daemon_reload: yes
|
||||
daemon_reload: yes
|
@@ -34,11 +34,16 @@
|
||||
notify: reload backup-docker-to-local.service
|
||||
when: run_once_backup_docker_to_local is not defined
|
||||
|
||||
- name: configure backup-docker-to-local.timer.tpl
|
||||
template: src=backup-docker-to-local.timer.j2 dest=/etc/systemd/system/backup-docker-to-local.timer
|
||||
register: backup_docker_to_local_timer
|
||||
changed_when: backup_docker_to_local_timer.changed or activate_all_timers | bool
|
||||
notify: restart backup-docker-to-local.timer
|
||||
- name: set service_name to the name of the current role
|
||||
set_fact:
|
||||
service_name: "{{ role_name }}"
|
||||
when: run_once_backup_docker_to_local is not defined
|
||||
|
||||
- name: "include role for systemd-timer for {{service_name}}"
|
||||
include_role:
|
||||
name: systemd-timer
|
||||
vars:
|
||||
on_calendar: "{{on_calendar_backup_docker_to_local}}"
|
||||
when: run_once_backup_docker_to_local is not defined
|
||||
|
||||
- name: seed database values
|
||||
|
@@ -1,10 +0,0 @@
|
||||
[Unit]
|
||||
Description=backups the docker volumes
|
||||
|
||||
[Timer]
|
||||
OnCalendar={{on_calendar_backup_docker_to_local}}
|
||||
RandomizedDelaySec={{randomized_delay_sec}}
|
||||
Persistent=false
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
Reference in New Issue
Block a user