From 873d11d5165d5e9b2cec83ab35a95ab1c33f3404 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Fri, 28 Jan 2022 17:28:56 +0100 Subject: [PATCH] Stop the autofs server if the mount point must be changed. --- tasks/autofs.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tasks/autofs.yml b/tasks/autofs.yml index f94e61d..c2c8c3b 100644 --- a/tasks/autofs.yml +++ b/tasks/autofs.yml @@ -15,6 +15,14 @@ when: ansible_distribution_file_variety == "RedHat" tags: [ 'nfs', 'autofs' ] +- name: Stop autofs if it is a 'hard' reconfiguration + block: + - name: Stop autofs + service: name=autofs state=stopped + when: autofs_hard_reconfig is defined and autofs_hard_reconfig + + tags: [ 'nfs', 'autofs', 'autofs_conf' ] + - name: Configure autofs and its maps block: - name: Create the mount points