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 authored and mortzu committed Mar 20, 2023
1 parent 32ececb commit 3c8d2d1
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 3c8d2d1

Please sign in to comment.