Skip to content

Commit

Permalink
Ceph settings: more moduler manila configuration
Browse files Browse the repository at this point in the history
Add more logic to the manila configuration so that both the cephfs
and the ganesha backend can be configured. Initially configures
just one of them (cephfs by default as ganesha is not deployed
by default), even though the code should be able to deploy
multiple manila backends, once a better condition is set.
  • Loading branch information
tosky committed May 14, 2024
1 parent 199a290 commit 6531c2d
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions hooks/playbooks/templates/config_ceph_backends.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,27 @@ patches:
path: /spec/manila/enabled
value: {{ cifmw_services_manila_enabled | default('false') }}

{% if cifmw_services_manila_enabled | default('false') | bool -%}
{% set _manila_backends = [] -%}
{% set _manila_protocols = [] -%}
{# TODO: the two backends are mutually exclusive right now, #}
{# but this condition could be rewritten to support both (or more) #}
{# and the rest of the code is ready to support more backends #}
{% if cifmw_ceph_daemons_layout.ceph_nfs_enabled | default(false) | bool -%}
{% set _ = _manila_backends.append('nfs') %}
{% set _ = _manila_protocols.append('cephfsnfs') %}
{% else %}
{% set _ = _manila_backends.append('cephfs') %}
{% set _ = _manila_protocols.append('cephfs') %}
{% endif %}
- op: add
path: /spec/manila/template/customServiceConfig
value: |
[DEFAULT]
enabled_share_backends=cephfs
enabled_share_protocols=cephfs
enabled_share_backends={{ _manila_backends|join(',') }}
enabled_share_protocols={{ _manila_protocols|join(',') }}
debug=True
{% if 'cephfs' in _manila_backends -%}
[cephfs]
driver_handles_share_servers=False
share_backend_name=cephfs
Expand All @@ -102,3 +116,15 @@ patches:
cephfs_cluster_name=ceph
cephfs_volume_mode=0755
cephfs_protocol_helper_type=CEPHFS
{% endif %}
{% if 'cephfsnfs' in _manila_backends -%}
[cephfsnfs]
driver_handles_share_servers=False
share_backend_name=cephfs
share_driver=manila.share.drivers.cephfs.driver.CephFSDriver
cephfs_auth_id=openstack
cephfs_cluster_name=ceph
cephfs_nfs_cluster_id=cephfs
cephfs_protocol_helper_type=NFS
{% endif %}
{% endif %}

0 comments on commit 6531c2d

Please sign in to comment.