Skip to content

Commit

Permalink
Use systemd module instead of command
Browse files Browse the repository at this point in the history
This patch changes the use of systemctl via the command module
over to the Ansible systemd module.

One conditional check for systemd was removed since all supported
distributions deployed by OSA have systemd.

Change-Id: I926e94d185f4999e13b33f7d035b9dd5cf732f0b
  • Loading branch information
major committed Feb 1, 2018
1 parent 1f5e998 commit ad29910
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
3 changes: 2 additions & 1 deletion tasks/install_zypper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@
- rabbitmq-config

- name: Reload the systemd daemon
command: "systemctl daemon-reload"
systemd:
daemon_reload: yes
when:
- rabbitmq_server_service_added | changed
tags:
Expand Down
6 changes: 2 additions & 4 deletions tasks/rabbitmq_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,15 @@
- rabbitmq_server-install

- name: Reload the systemd daemon
command: "systemctl daemon-reload"
systemd:
daemon_reload: yes
when:
- install_rabbitmq | changed
- ansible_service_mgr == 'systemd'
tags:
- rabbitmq-apt-packages
- rabbitmq-yum-packages
- rabbimtq-zypper-packages
- rabbitmq_server-install
# Avoid ANSIBLE0006 systemctl used in place of systemd module issue
- skip_ansible_lint

- name: Ensure there are no policy-rc files
file:
Expand Down
3 changes: 2 additions & 1 deletion tasks/rabbitmq_post_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@
- rabbitmq-config

- name: Reload the systemd daemon
command: "systemctl daemon-reload"
systemd:
daemon_reload: yes
when:
- ansible_service_mgr == 'systemd'
- rabbit_resource_limit | changed
Expand Down

0 comments on commit ad29910

Please sign in to comment.