From 9a62d006bd43d6a02f861115fb96a657dafb1e70 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Mon, 7 Oct 2019 10:21:51 +0200 Subject: [PATCH] nfs: stop nfs server service The syntax here wasn't working, this refact fixes this task. Also, removing the `ignore_errors: true` which was hidding the failure. Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1508506 Signed-off-by: Guillaume Abrioux (cherry picked from commit 47034effe0bb7de14442b0ba884ff4abe793b4b7) --- roles/ceph-nfs/tasks/pre_requisite_non_container.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/ceph-nfs/tasks/pre_requisite_non_container.yml b/roles/ceph-nfs/tasks/pre_requisite_non_container.yml index f16f53e45..0af7e9bf2 100644 --- a/roles/ceph-nfs/tasks/pre_requisite_non_container.yml +++ b/roles/ceph-nfs/tasks/pre_requisite_non_container.yml @@ -95,7 +95,7 @@ - name: stop nfs server service systemd: - name: "{%- if ansible_os_family == 'RedHat' 'nfs-server' %}{%- endif %}{%- if ansible_os_family == 'Suse' 'nfsserver' %}{%- endif %}{%- if ansible_os_family == 'Debian' 'nfs-kernel-server' %}{%- endif %}" + name: "{{ 'nfs-server' if ansible_os_family == 'RedHat' else 'nfsserver' if ansible_os_family == 'Suse' else 'nfs-kernel-server' if ansible_os_family == 'Debian' }}" state: stopped enabled: no - ignore_errors: true + failed_when: false