From 8c510ab9f94635e1803c19b558f1e8bb1cfd632b Mon Sep 17 00:00:00 2001 From: Jan Provaznik Date: Tue, 19 Sep 2017 11:59:54 +0200 Subject: [PATCH] Make ceph-nfs service enablement/start optional When ceph-nfs service is managed by pacemaker, it's useful to not enable and start ceph-nfs service through systemd but let pacemaker to start the service in a next step. --- roles/ceph-nfs/defaults/main.yml | 4 ++++ roles/ceph-nfs/tasks/docker/start_docker_nfs.yml | 3 +++ roles/ceph-nfs/tasks/pre_requisite.yml | 1 + 3 files changed, 8 insertions(+) diff --git a/roles/ceph-nfs/defaults/main.yml b/roles/ceph-nfs/defaults/main.yml index bfea2bf3b..320879ed3 100644 --- a/roles/ceph-nfs/defaults/main.yml +++ b/roles/ceph-nfs/defaults/main.yml @@ -10,6 +10,10 @@ # distributed on RGW nodes. Setting 'copy_admin_key' to 'true' # will copy the admin key to the /etc/ceph/ directory copy_admin_key: false +# whether docker container or systemd service should be enabled +# and started, it's useful to set it to false if nfs-ganesha +# service is managed by pacemaker +ceph_nfs_enable_service: true ####################### # Access type options # diff --git a/roles/ceph-nfs/tasks/docker/start_docker_nfs.yml b/roles/ceph-nfs/tasks/docker/start_docker_nfs.yml index 254ecf4e5..cdf9bb0c5 100644 --- a/roles/ceph-nfs/tasks/docker/start_docker_nfs.yml +++ b/roles/ceph-nfs/tasks/docker/start_docker_nfs.yml @@ -12,11 +12,13 @@ shell: systemctl enable ceph-nfs@{{ ansible_hostname }}.service failed_when: false changed_when: false + when: ceph_nfs_enable_service - name: reload systemd unit files shell: systemctl daemon-reload changed_when: false failed_when: false + when: ceph_nfs_enable_service - name: systemd start nfs container service: @@ -24,3 +26,4 @@ state: started enabled: yes changed_when: false + when: ceph_nfs_enable_service diff --git a/roles/ceph-nfs/tasks/pre_requisite.yml b/roles/ceph-nfs/tasks/pre_requisite.yml index 665345097..befcb3db0 100644 --- a/roles/ceph-nfs/tasks/pre_requisite.yml +++ b/roles/ceph-nfs/tasks/pre_requisite.yml @@ -96,3 +96,4 @@ name: nfs-ganesha state: started enabled: yes + when: ceph_nfs_enable_service