From 6c9f3a08a7af7a02f8948fe70272002116e1939b Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Sat, 16 Sep 2017 23:36:29 +0200 Subject: [PATCH] rgw: refact start_docker_rgw.yml remove usage of `shell` module in favor of `systemd` module. Signed-off-by: Guillaume Abrioux --- .../tasks/docker/start_docker_rgw.yml | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/roles/ceph-rgw/tasks/docker/start_docker_rgw.yml b/roles/ceph-rgw/tasks/docker/start_docker_rgw.yml index 3bce3d4fe..d81a6c669 100644 --- a/roles/ceph-rgw/tasks/docker/start_docker_rgw.yml +++ b/roles/ceph-rgw/tasks/docker/start_docker_rgw.yml @@ -10,24 +10,20 @@ # For backward compatibility - name: disable old systemd unit ('ceph-rgw@') if present - service: - name: ceph-rgw@{{ ansible_hostname }} - state: disable + systemd: + name: "{{ item }}" + state: stopped + enabled: no + daemon_reload: yes + with_items: + - "ceph-rgw@{{ ansible_hostname }}" + - "ceph-radosgw@{{ ansible_hostname }}.service" ignore_errors: true -- name: enable systemd unit file for rgw instance - shell: systemctl enable ceph-radosgw@{{ ansible_hostname }}.service - failed_when: false - changed_when: false - -- name: reload systemd unit files - shell: systemctl daemon-reload - changed_when: false - failed_when: false - - name: systemd start rgw container - service: - name: ceph-radosgw@{{ ansible_hostname }} + systemd: + name: "ceph-radosgw@rgw.{{ ansible_hostname }}.service" state: started enabled: yes + daemon_reload: yes changed_when: false