summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Powell <zifnab@zifnab06.net>2017-04-23 16:40:51 -0700
committerTom Powell <zifnab@zifnab06.net>2017-04-23 16:40:51 -0700
commit7dd1f1845a39a4d19d64f2a6ca95345c6b10a3b7 (patch)
tree8a8987ef9967cd5718caa7fdb74efbe310270118
parentba5832568c76103f829e282512c2cb77d874f6a3 (diff)
downloadansible-7dd1f1845a39a4d19d64f2a6ca95345c6b10a3b7.tar.gz
ansible-7dd1f1845a39a4d19d64f2a6ca95345c6b10a3b7.tar.bz2
ansible-7dd1f1845a39a4d19d64f2a6ca95345c6b10a3b7.zip
Don't restart rsync if no changes have been made
-rw-r--r--roles/mirror/handlers/main.yml5
-rw-r--r--roles/mirror/tasks/main.yml8
2 files changed, 6 insertions, 7 deletions
diff --git a/roles/mirror/handlers/main.yml b/roles/mirror/handlers/main.yml
new file mode 100644
index 0000000..4af4958
--- /dev/null
+++ b/roles/mirror/handlers/main.yml
@@ -0,0 +1,5 @@
+---
+- name: restart rsync
+ systemd:
+ name: rsync
+ state: restarted
diff --git a/roles/mirror/tasks/main.yml b/roles/mirror/tasks/main.yml
index a75f984..c232d15 100644
--- a/roles/mirror/tasks/main.yml
+++ b/roles/mirror/tasks/main.yml
@@ -23,13 +23,7 @@
owner: root
group: root
mode: 0644
-
-- name: restart rsync
- systemd:
- name: rsync
- enabled: yes
- state: restarted
- daemon-reload: yes
+ notify: restart rsync
- name: install mirror timestamp rsync
cron: