Skip to content

Commit

Permalink
Ensure to run cephfs task for nfs ganesha
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
katarimanojk committed May 27, 2024
1 parent a1e6798 commit 67e8fcc
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 12 deletions.
8 changes: 7 additions & 1 deletion playbooks/ceph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
11 changes: 0 additions & 11 deletions roles/cifmw_cephadm/tasks/cephfs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
26 changes: 26 additions & 0 deletions roles/cifmw_cephadm/tasks/cephnfs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
# 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.

# 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
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

0 comments on commit 67e8fcc

Please sign in to comment.