2024-12-01 15:02:09 +01:00
|
|
|
- block:
|
2024-12-04 17:41:29 +01:00
|
|
|
- name: "create {{restart_docker_folder}}"
|
2024-12-01 15:02:09 +01:00
|
|
|
file:
|
2024-12-04 17:41:29 +01:00
|
|
|
path: "{{restart_docker_folder}}"
|
2024-12-01 15:02:09 +01:00
|
|
|
state: directory
|
|
|
|
mode: 0755
|
|
|
|
|
|
|
|
- name: create {{restart_docker_script}}
|
|
|
|
copy:
|
|
|
|
src: restart-docker.py
|
|
|
|
dest: "{{restart_docker_script}}"
|
|
|
|
|
|
|
|
- name: configure restart-docker.cymais.service
|
|
|
|
template:
|
|
|
|
src: restart-docker.service.j2
|
|
|
|
dest: /etc/systemd/system/restart-docker.cymais.service
|
|
|
|
notify: "reload restart-docker.cymais.service"
|
|
|
|
|
|
|
|
- name: set service_name to the name of the current role
|
|
|
|
set_fact:
|
|
|
|
service_name: "{{ role_name }}"
|
|
|
|
|
2024-12-01 15:05:17 +01:00
|
|
|
- name: "include role for systemd-timer for {{service_name}}"
|
|
|
|
include_role:
|
|
|
|
name: systemd-timer
|
|
|
|
vars:
|
|
|
|
on_calendar: "{{on_calendar_restart_docker}}"
|
2024-12-01 15:02:09 +01:00
|
|
|
|
2024-12-01 15:05:17 +01:00
|
|
|
- name: run the restart_docker_volumes tasks once
|
|
|
|
set_fact:
|
|
|
|
run_once_restart_docker: true
|
|
|
|
|
2024-12-01 15:02:09 +01:00
|
|
|
when: run_once_restart_docker is not defined
|