computer-playbook/roles/restart-docker/tasks/main.yml

37 lines
1.1 KiB
YAML

- block:
- name: "create {{restart_docker_volumes_folder}}"
file:
path: "{{restart_docker_volumes_folder}}"
state: directory
mode: 0755
- name: create {{restart_docker_script}}
copy:
src: restart-docker.py
dest: "{{restart_docker_script}}"
when: run_once_restart_docker is not defined
- 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"
when: run_once_restart_docker is not defined
- name: set service_name to the name of the current role
set_fact:
service_name: "{{ role_name }}"
when: run_once_restart_docker is not defined
when: run_once_restart_docker is not defined
- name: "include role for systemd-timer for {{service_name}}"
include_role:
name: systemd-timer
vars:
on_calendar: "{{on_calendar_restart_docker}}"
when: run_once_restart_docker is not defined
- name: run the restart_docker_volumes tasks once
set_fact:
run_once_restart_docker: true
when: run_once_restart_docker is not defined