From 0028e3a1045b35616fc2d7beaca4d7543fd36985 Mon Sep 17 00:00:00 2001 From: mkatari Date: Thu, 16 May 2024 12:21:18 +0530 Subject: [PATCH] Ensure to run cephfs task for nfs ganesha This patch updates when condition for cephfs task in ceph playbook so that nfs ganesha deployment is never skipped if ceph_nfs_enabled is true. --- playbooks/ceph.yml | 8 +++++++- roles/cifmw_cephadm/tasks/cephfs.yml | 11 ----------- roles/cifmw_cephadm/tasks/cephnfs.yml | 23 +++++++++++++++++++++++ 3 files changed, 30 insertions(+), 12 deletions(-) create mode 100644 roles/cifmw_cephadm/tasks/cephnfs.yml diff --git a/playbooks/ceph.yml b/playbooks/ceph.yml index 25462abc06..61e08f22a6 100644 --- a/playbooks/ceph.yml +++ b/playbooks/ceph.yml @@ -368,10 +368,16 @@ cifmw_cephadm_dashboard_key: "{{ cifmw_cephadm_key }}" - name: Create cephfs volume - when: cifmw_ceph_daemons_layout.cephfs_enabled | default(true) | bool + when: (cifmw_ceph_daemons_layout.cephfs_enabled | default(true) | bool) or (cifmw_ceph_daemons_layout.ceph_nfs_enabled | default(false) | bool) ansible.builtin.import_role: name: cifmw_cephadm tasks_from: cephfs + + - name: Deploy cephnfs + when: cifmw_ceph_daemons_layout.ceph_nfs_enabled | default(false) | bool + ansible.builtin.import_role: + name: cifmw_cephadm + tasks_from: cephnfs vars: # we reuse the same VIP reserved for rgw cifmw_cephadm_nfs_vip: "{{ cifmw_cephadm_vip }}/24" diff --git a/roles/cifmw_cephadm/tasks/cephfs.yml b/roles/cifmw_cephadm/tasks/cephfs.yml index f8b1f303f2..c5947c94f1 100644 --- a/roles/cifmw_cephadm/tasks/cephfs.yml +++ b/roles/cifmw_cephadm/tasks/cephfs.yml @@ -62,14 +62,3 @@ ansible.builtin.command: "{{ cifmw_cephadm_ceph_cli }} orch apply --in-file {{ cifmw_cephadm_container_spec }}" become: true -# waiting for https://github.com/ceph/ceph/pull/53108 -# to appear in the next Ceph container build -# disabling this task by default for now -- name: Create NFS Ganesha Cluster - when: cifmw_ceph_daemons_layout.ceph_nfs_enabled | default(false) | bool - ansible.builtin.command: | - {{ cifmw_cephadm_ceph_cli }} nfs cluster create {{ cifmw_cephadm_cephfs_name }} \ - --ingress --virtual-ip={{ cifmw_cephadm_nfs_vip }} \ - --ingress-mode=haproxy-protocol '--placement={{ placement }}' - changed_when: false - become: true diff --git a/roles/cifmw_cephadm/tasks/cephnfs.yml b/roles/cifmw_cephadm/tasks/cephnfs.yml new file mode 100644 index 0000000000..5742f81d79 --- /dev/null +++ b/roles/cifmw_cephadm/tasks/cephnfs.yml @@ -0,0 +1,23 @@ +--- +# Copyright Red Hat, Inc. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +- name: Create NFS Ganesha Cluster + ansible.builtin.command: | + {{ cifmw_cephadm_ceph_cli }} nfs cluster create {{ cifmw_cephadm_cephfs_name }} \ + --ingress --virtual-ip={{ cifmw_cephadm_nfs_vip }} \ + --ingress-mode=haproxy-protocol '--placement={{ placement }}' + changed_when: false + become: true