Skip to content

Commit

Permalink
Convert 'systemd' handler into a normal task
Browse files Browse the repository at this point in the history
  • Loading branch information
drybjed committed May 19, 2016
1 parent 217b75d commit 490cc9e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ v0.1.1

- Make sure that role works in Ansible check mode. [drybjed]

- Change the ``systemd`` handler into a task, so that the ``systemd``
configuration is reloaded as soon as possible. [drybjed]

v0.1.0
------

Expand Down
5 changes: 0 additions & 5 deletions handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
---

- name: Reload systemd daemon and enable snmpd.service
shell: systemctl daemon-reload ; systemctl enable snmpd.service
when: (ansible_local|d() and ansible_local.init|d() and
ansible_local.init == "systemd")

- name: Restart snmpd
service:
name: 'snmpd'
Expand Down
7 changes: 6 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@
owner: 'root'
group: 'root'
mode: '0644'
notify: [ 'Reload systemd daemon', 'Restart snmpd' ]
notify: [ 'Restart snmpd' ]

- name: Reload systemd daemon and enable snmpd.service
shell: systemctl daemon-reload ; systemctl enable snmpd.service
when: ((ansible_local|d() and ansible_local.init|d() and
ansible_local.init == "systemd") and not ansible_local.snmpd|d())

- name: Allow 'snmp' user access to /proc if needed
user:
Expand Down

0 comments on commit 490cc9e

Please sign in to comment.