From 46e092eaf1c385db3636983f26b84c7cf29b3128 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Han?= Date: Thu, 28 Jun 2018 09:53:03 +0200 Subject: [PATCH] systemd: remove changed_when: false MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When using a module there is no need to apply this Ansible option. The module will handle the idempotency on its own. So the module decides wether or not the task has changed during the execution. Signed-off-by: Sébastien Han (cherry picked from commit f6239972716b013bafcb9313c9c83723615aa7d6) # Conflicts: # roles/ceph-iscsi-gw/tasks/container/containerized.yml --- .../tasks/container/containerized.yml | 26 +++++++++++++++++++ roles/ceph-mds/tasks/containerized.yml | 1 - .../tasks/docker/start_docker_mgr.yml | 3 +-- .../tasks/docker/start_docker_monitor.yml | 3 +-- .../tasks/docker/start_docker_rbd_mirror.yml | 3 +-- .../tasks/docker/start_docker_rgw.yml | 3 +-- 6 files changed, 30 insertions(+), 9 deletions(-) create mode 100644 roles/ceph-iscsi-gw/tasks/container/containerized.yml diff --git a/roles/ceph-iscsi-gw/tasks/container/containerized.yml b/roles/ceph-iscsi-gw/tasks/container/containerized.yml new file mode 100644 index 000000000..a7316c475 --- /dev/null +++ b/roles/ceph-iscsi-gw/tasks/container/containerized.yml @@ -0,0 +1,26 @@ +--- +- name: generate systemd unit files for tcmu-runner, rbd-target-api and rbd-target-gw + become: true + template: + src: "{{ role_path }}/templates/{{ item }}.service.j2" + dest: /etc/systemd/system/{{ item }}.service + owner: "root" + group: "root" + mode: "0644" + with_items: + - tcmu-runner + - rbd-target-gw + - rbd-target-api + notify: + - restart ceph {{ item }} + +- name: systemd start tcmu-runner, rbd-target-api and rbd-target-gw containers + systemd: + name: "{{ item }}" + state: started + enabled: yes + daemon_reload: yes + with_items: + - tcmu-runner + - rbd-target-gw + - rbd-target-api diff --git a/roles/ceph-mds/tasks/containerized.yml b/roles/ceph-mds/tasks/containerized.yml index c7ecca308..c3cc1f22c 100644 --- a/roles/ceph-mds/tasks/containerized.yml +++ b/roles/ceph-mds/tasks/containerized.yml @@ -73,7 +73,6 @@ state: started enabled: yes daemon_reload: yes - changed_when: false - name: wait for mds socket to exist command: "{{ docker_exec_cmd }} sh -c 'stat /var/run/ceph/{{ cluster }}-mds.{{ ansible_hostname }}.asok || stat /var/run/ceph/{{ cluster }}-mds.{{ ansible_fqdn }}.asok'" diff --git a/roles/ceph-mgr/tasks/docker/start_docker_mgr.yml b/roles/ceph-mgr/tasks/docker/start_docker_mgr.yml index ad78bdcc2..40e623bf8 100644 --- a/roles/ceph-mgr/tasks/docker/start_docker_mgr.yml +++ b/roles/ceph-mgr/tasks/docker/start_docker_mgr.yml @@ -15,5 +15,4 @@ name: ceph-mgr@{{ ansible_hostname }} state: started enabled: yes - daemon_reload: yes - changed_when: false + daemon_reload: yes \ No newline at end of file diff --git a/roles/ceph-mon/tasks/docker/start_docker_monitor.yml b/roles/ceph-mon/tasks/docker/start_docker_monitor.yml index 02b7209f1..8df4826d2 100644 --- a/roles/ceph-mon/tasks/docker/start_docker_monitor.yml +++ b/roles/ceph-mon/tasks/docker/start_docker_monitor.yml @@ -56,5 +56,4 @@ name: ceph-mon@{{ ansible_hostname }} state: started enabled: yes - daemon_reload: yes - changed_when: false + daemon_reload: yes \ No newline at end of file diff --git a/roles/ceph-rbd-mirror/tasks/docker/start_docker_rbd_mirror.yml b/roles/ceph-rbd-mirror/tasks/docker/start_docker_rbd_mirror.yml index fb57cded5..6bb2844f6 100644 --- a/roles/ceph-rbd-mirror/tasks/docker/start_docker_rbd_mirror.yml +++ b/roles/ceph-rbd-mirror/tasks/docker/start_docker_rbd_mirror.yml @@ -16,5 +16,4 @@ name: ceph-rbd-mirror@rbd-mirror.{{ ansible_hostname }} state: started enabled: yes - daemon_reload: yes - changed_when: false + daemon_reload: yes \ No newline at end of file diff --git a/roles/ceph-rgw/tasks/docker/start_docker_rgw.yml b/roles/ceph-rgw/tasks/docker/start_docker_rgw.yml index 4b8ca17f8..83c270d75 100644 --- a/roles/ceph-rgw/tasks/docker/start_docker_rgw.yml +++ b/roles/ceph-rgw/tasks/docker/start_docker_rgw.yml @@ -29,5 +29,4 @@ name: "ceph-radosgw@rgw.{{ ansible_hostname }}.service" state: started enabled: yes - daemon_reload: yes - changed_when: false + daemon_reload: yes \ No newline at end of file -- 2.47.3