diff options
author | Giulio Fidente <gfidente@redhat.com> | 2016-10-05 14:37:09 +0200 |
---|---|---|
committer | Giulio Fidente <gfidente@redhat.com> | 2016-10-07 12:21:48 +0200 |
commit | 5ac7ec551b76bc8c2b6de2281f7d86591f192f23 (patch) | |
tree | 4974e70bc487b11314bbab00fd12065a65246575 /manifests | |
parent | 9df180aae231309ac8571a9048f1188b0c203dfb (diff) |
Set enabled_share_protocols based on enabled backends
When deploying manila with cephfs, share creation fails because
'enabled_share_protocols' sticks to NFS,CIFS and does not get updated
with CEPHFS. This change aims at fixing it by building the list of
enabled protocols based on the list of enabled backends.
Co-Authored-By: Tom Barron <tbarron@redhat.com>
Closes-Bug: 1630564
Change-Id: I86ba8b9d5872c0f1a94e74215e97b796ad129bfb
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/profile/base/manila/api.pp | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/manifests/profile/base/manila/api.pp b/manifests/profile/base/manila/api.pp index 1f78ab3..021fffd 100644 --- a/manifests/profile/base/manila/api.pp +++ b/manifests/profile/base/manila/api.pp @@ -18,6 +18,18 @@ # # === Parameters # +# [*backend_generic_enabled*] +# (Optional) Whether or not the generic backend is enabled +# Defaults to hiera('manila_backend_generic_enabled', false) +# +# [*backend_netapp_enabled*] +# (Optional) Whether or not the netapp backend is enabled +# Defaults to hiera('manila_backend_netapp_enabled', false) +# +# [*backend_cephfs_enabled*] +# (Optional) Whether or not the cephfs backend is enabled +# Defaults to hiera('manila_backend_cephfs_enabled', false) +# # [*bootstrap_node*] # (Optional) The hostname of the node responsible for bootstrapping tasks # Defaults to hiera('bootstrap_nodeid') @@ -28,8 +40,11 @@ # Defaults to hiera('step') class tripleo::profile::base::manila::api ( - $bootstrap_node = hiera('bootstrap_nodeid', undef), - $step = hiera('step'), + $backend_generic_enabled = hiera('manila_backend_generic_enabled', false), + $backend_netapp_enabled = hiera('manila_backend_netapp_enabled', false), + $backend_cephfs_enabled = hiera('manila_backend_cephfs_enabled', false), + $bootstrap_node = hiera('bootstrap_nodeid', undef), + $step = hiera('step'), ) { if $::hostname == downcase($bootstrap_node) { $sync_db = true @@ -40,6 +55,20 @@ class tripleo::profile::base::manila::api ( include ::tripleo::profile::base::manila if $step >= 4 or ($step >= 3 and $sync_db) { - include ::manila::api + if $backend_generic_enabled or $backend_netapp_enabled { + $nfs_protocol = 'NFS' + $cifs_protocol = 'CIFS' + } else { + $nfs_protocol = undef + $cifs_protocol = undef + } + if $backend_cephfs_enabled { + $cephfs_protocol = 'CEPHFS' + } else { + $cephfs_protocol = undef + } + class { '::manila::api' : + enabled_share_protocols => join(delete_undef_values([$nfs_protocol,$cifs_protocol,$cephfs_protocol]), ',') + } } } |