From cbe79428e687e383f9764668a56171e5582451be Mon Sep 17 00:00:00 2001 From: Dimitri Savineau Date: Tue, 21 Jul 2020 15:22:26 -0400 Subject: [PATCH] ceph-handler: remove iscsigws restart scripts The iscsigws restart scripts for tcmu-runner and rbd-target-{api,gw} services only call the systemctl restart command. We don't really need to copy a shell script to do it when we can use the ansible service module instead. Signed-off-by: Dimitri Savineau --- roles/ceph-handler/handlers/main.yml | 4 ---- .../tasks/handler_rbd_target_api_gw.yml | 24 +++++-------------- .../tasks/handler_tcmu_runner.yml | 12 +++------- .../templates/restart_rbd_target_api.sh.j2 | 3 --- .../templates/restart_rbd_target_gw.sh.j2 | 3 --- .../templates/restart_tcmu_runner.sh.j2 | 3 --- 6 files changed, 9 insertions(+), 40 deletions(-) delete mode 100644 roles/ceph-handler/templates/restart_rbd_target_api.sh.j2 delete mode 100644 roles/ceph-handler/templates/restart_rbd_target_gw.sh.j2 delete mode 100644 roles/ceph-handler/templates/restart_tcmu_runner.sh.j2 diff --git a/roles/ceph-handler/handlers/main.yml b/roles/ceph-handler/handlers/main.yml index ede442c91..463a27220 100644 --- a/roles/ceph-handler/handlers/main.yml +++ b/roles/ceph-handler/handlers/main.yml @@ -16,8 +16,6 @@ - "restart ceph nfss" - "restart ceph rbdmirrors" - "restart ceph mgrs" - - "restart ceph tcmu-runner" - - "restart ceph rbd-target-api-gw" register: tmpdirpath when: tmpdirpath is not defined or tmpdirpath.path is not defined or tmpdirpath.state=="absent" @@ -89,7 +87,5 @@ - "restart ceph nfss" - "restart ceph rbdmirrors" - "restart ceph mgrs" - - "restart ceph tcmu-runner" - - "restart ceph rbd-target-api-gw" register: tmpdirpath when: tmpdirpath is defined diff --git a/roles/ceph-handler/tasks/handler_rbd_target_api_gw.yml b/roles/ceph-handler/tasks/handler_rbd_target_api_gw.yml index f792c1458..903d333f7 100644 --- a/roles/ceph-handler/tasks/handler_rbd_target_api_gw.yml +++ b/roles/ceph-handler/tasks/handler_rbd_target_api_gw.yml @@ -3,16 +3,10 @@ set_fact: _rbd_target_api_handler_called: True -- name: copy rbd-target-api restart script - template: - src: restart_rbd_target_api.sh.j2 - dest: "{{ tmpdirpath.path }}/restart_rbd_target_api.sh" - owner: root - group: root - mode: 0750 - - name: restart rbd-target-api - command: /usr/bin/env bash {{ hostvars[item]['tmpdirpath']['path'] }}/restart_rbd_target_api.sh + service: + name: rbd-target-api + state: restarted when: - ceph_rbd_target_api_stat.get('rc') == 0 - hostvars[item]['_rbd_target_api_handler_called'] | default(False) | bool @@ -29,16 +23,10 @@ set_fact: _rbd_target_gw_handler_called: True -- name: copy rbd-target-gw restart script - template: - src: restart_rbd_target_gw.sh.j2 - dest: "{{ tmpdirpath.path }}/restart_rbd_target_gw.sh" - owner: root - group: root - mode: 0750 - - name: restart rbd-target-gw - command: /usr/bin/env bash {{ hostvars[item]['tmpdirpath']['path'] }}/restart_rbd_target_gw.sh + service: + name: rbd-target-gw + state: restarted when: - ceph_rbd_target_gw_stat.get('rc') == 0 - hostvars[item]['_rbd_target_gw_handler_called'] | default(False) | bool diff --git a/roles/ceph-handler/tasks/handler_tcmu_runner.yml b/roles/ceph-handler/tasks/handler_tcmu_runner.yml index 70e9d50b6..3dd31e0e9 100644 --- a/roles/ceph-handler/tasks/handler_tcmu_runner.yml +++ b/roles/ceph-handler/tasks/handler_tcmu_runner.yml @@ -3,16 +3,10 @@ set_fact: _tcmu_runner_handler_called: True -- name: copy tcmu-runner restart script - template: - src: restart_tcmu_runner.sh.j2 - dest: "{{ tmpdirpath.path }}/restart_tcmu_runner.sh" - owner: root - group: root - mode: 0750 - - name: restart tcmu-runner - command: /usr/bin/env bash {{ hostvars[item]['tmpdirpath']['path'] }}/restart_tcmu_runner.sh + service: + name: tcmu-runner + state: restarted when: - ceph_tcmu_runner_stat.get('rc') == 0 - hostvars[item]['_tcmu_runner_handler_called'] | default(False) | bool diff --git a/roles/ceph-handler/templates/restart_rbd_target_api.sh.j2 b/roles/ceph-handler/templates/restart_rbd_target_api.sh.j2 deleted file mode 100644 index fd477c37a..000000000 --- a/roles/ceph-handler/templates/restart_rbd_target_api.sh.j2 +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -systemctl restart rbd-target-api diff --git a/roles/ceph-handler/templates/restart_rbd_target_gw.sh.j2 b/roles/ceph-handler/templates/restart_rbd_target_gw.sh.j2 deleted file mode 100644 index 10c34bfa2..000000000 --- a/roles/ceph-handler/templates/restart_rbd_target_gw.sh.j2 +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -systemctl restart rbd-target-gw diff --git a/roles/ceph-handler/templates/restart_tcmu_runner.sh.j2 b/roles/ceph-handler/templates/restart_tcmu_runner.sh.j2 deleted file mode 100644 index 5dd5ff842..000000000 --- a/roles/ceph-handler/templates/restart_tcmu_runner.sh.j2 +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -systemctl restart tcmu-runner