refactored and solved bugs in restart docker role

This commit is contained in:
Kevin Veen-Birkenbach 2024-12-01 15:05:17 +01:00
parent 85816d702a
commit 8481b3ddfe

View File

@ -9,29 +9,25 @@
copy: copy:
src: restart-docker.py src: restart-docker.py
dest: "{{restart_docker_script}}" dest: "{{restart_docker_script}}"
when: run_once_restart_docker is not defined
- name: configure restart-docker.cymais.service - name: configure restart-docker.cymais.service
template: template:
src: restart-docker.service.j2 src: restart-docker.service.j2
dest: /etc/systemd/system/restart-docker.cymais.service dest: /etc/systemd/system/restart-docker.cymais.service
notify: "reload 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 - name: set service_name to the name of the current role
set_fact: set_fact:
service_name: "{{ role_name }}" 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}}" - name: "include role for systemd-timer for {{service_name}}"
include_role: include_role:
name: systemd-timer name: systemd-timer
vars: vars:
on_calendar: "{{on_calendar_restart_docker}}" on_calendar: "{{on_calendar_restart_docker}}"
when: run_once_restart_docker is not defined
- name: run the restart_docker_volumes tasks once - name: run the restart_docker_volumes tasks once
set_fact: set_fact:
run_once_restart_docker: true run_once_restart_docker: true
when: run_once_restart_docker is not defined when: run_once_restart_docker is not defined