From cb66a62ae24f0ef9eee25a71a57559e36b70f961 Mon Sep 17 00:00:00 2001 From: Giulio Fidente Date: Mon, 9 Sep 2019 19:07:02 +0200 Subject: [PATCH] Look for additional names when checking ceph-nfs container status Ganesha cannot be operated active/active, in those deployments where it is managed by pacemaker the container name can be different than the default. This change uses "ceph_nfs_service_suffix" where previously missing to ensure tasks will work with customized names. Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1750005 Signed-off-by: Giulio Fidente (cherry picked from commit d2a2bd7c423182b60460bffa6b3d6a28c7d12227) --- roles/ceph-handler/tasks/check_running_containers.yml | 2 +- roles/ceph-handler/templates/restart_nfs_daemon.sh.j2 | 2 +- roles/ceph-nfs/tasks/main.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/ceph-handler/tasks/check_running_containers.yml b/roles/ceph-handler/tasks/check_running_containers.yml index 6720c8085..cd6539235 100644 --- a/roles/ceph-handler/tasks/check_running_containers.yml +++ b/roles/ceph-handler/tasks/check_running_containers.yml @@ -48,7 +48,7 @@ when: inventory_hostname in groups.get(rbdmirror_group_name, []) - name: check for a nfs container - command: "{{ container_binary }} ps -q --filter='name=ceph-nfs-{{ ansible_hostname }}'" + command: "{{ container_binary }} ps -q --filter='name=ceph-nfs-{{ ceph_nfs_service_suffix | default(ansible_hostname) }}'" register: ceph_nfs_container_stat changed_when: false failed_when: false diff --git a/roles/ceph-handler/templates/restart_nfs_daemon.sh.j2 b/roles/ceph-handler/templates/restart_nfs_daemon.sh.j2 index 39f304bfb..0fab87cc0 100644 --- a/roles/ceph-handler/templates/restart_nfs_daemon.sh.j2 +++ b/roles/ceph-handler/templates/restart_nfs_daemon.sh.j2 @@ -5,7 +5,7 @@ DELAY="{{ handler_health_nfs_check_delay }}" NFS_NAME="ceph-nfs@{{ ceph_nfs_service_suffix | default(ansible_hostname) }}" PID=/var/run/ganesha.pid {% if containerized_deployment %} -DOCKER_EXEC="{{ container_binary }} exec ceph-nfs-{{ ansible_hostname }}" +DOCKER_EXEC="{{ container_binary }} exec ceph-nfs-{{ ceph_nfs_service_suffix | default(ansible_hostname) }}" {% endif %} # First, restart the daemon diff --git a/roles/ceph-nfs/tasks/main.yml b/roles/ceph-nfs/tasks/main.yml index 80f614e52..273889361 100644 --- a/roles/ceph-nfs/tasks/main.yml +++ b/roles/ceph-nfs/tasks/main.yml @@ -1,7 +1,7 @@ --- - name: set_fact container_exec_cmd set_fact: - container_exec_cmd: "{{ container_binary }} exec ceph-nfs-{{ ansible_hostname }}" + container_exec_cmd: "{{ container_binary }} exec ceph-nfs-{{ ceph_nfs_service_suffix | default(ansible_hostname) }}" when: containerized_deployment | bool - name: include pre_requisite_non_container.yml