Skip to content

Commit

Permalink
timer: Reload systemd in the correct way
Browse files Browse the repository at this point in the history
  • Loading branch information
mortzu committed Sep 26, 2021
1 parent d495efd commit 82be011
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 4 additions & 0 deletions roles/timer/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
- name: reload systemd
systemd:
daemon_reload: yes
7 changes: 1 addition & 6 deletions roles/timer/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,10 @@
with_items:
- service
- timer
register: template_result

- name: Reload systemd
command: systemctl daemon-reload
when: template_result.changed
notify: reload systemd

- name: Enable and start timer
service:
name: "{{ timer_name }}.timer"
daemon_reload: yes
enabled: yes
state: started

0 comments on commit 82be011

Please sign in to comment.