From 44afda839aad275877e431e18131569c696e7aee Mon Sep 17 00:00:00 2001 From: Goutham Pacha Ravi Date: Wed, 29 May 2019 12:40:19 -0700 Subject: [PATCH] Allow external Ganesha for the cephfs manila backend Parameters are added here [1]; however one can use ControllerExtraConfig to configure the missing params. [1] https://review.opendev.org/#/c/661287/ See: blueprint manila-external-ganesha Co-Authored-By: Giulio Fidente Change-Id: Ib8e7ef5b58cc0a6d125502081c1459ccf6648ee2 --- .../profile/pacemaker/manila/share_bundle.pp | 17 ++++++----------- ...rofile_pacemaker_manila_share_bundle_spec.rb | 8 ++++---- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/manifests/profile/pacemaker/manila/share_bundle.pp b/manifests/profile/pacemaker/manila/share_bundle.pp index f63090d76..382d23828 100644 --- a/manifests/profile/pacemaker/manila/share_bundle.pp +++ b/manifests/profile/pacemaker/manila/share_bundle.pp @@ -18,9 +18,9 @@ # # === Parameters # -# [*backend_cephfs_enabled*] -# (Optional) Whether or not the cephfs backend is enabled -# Defaults to hiera('manila_backend_cephfs_enabled', false) +# [*ceph_nfs_enabled*] +# (Optional) Whether or not the ceph_nfs service is enabled +# Defaults to hiera('ceph_nfs_enabled', false) # # [*manila_share_docker_image*] # (Optional) The docker image to use for creating the pacemaker bundle @@ -34,10 +34,6 @@ # (Optional) The list of environment variables set in the docker container # Defaults to ['KOLLA_CONFIG_STRATEGY=COPY_ALWAYS'] # -# [*backend_cephfs_enabled*] -# (Optional) Whether the CephFS Manila backend is enabled -# Defaults to hiera('manila_backend_cephfs_enabled', false) -# # [*pcs_tries*] # (Optional) The number of times pcs commands should be retried. # Defaults to hiera('pcs_tries', 20) @@ -61,7 +57,7 @@ class tripleo::profile::pacemaker::manila::share_bundle ( $manila_share_docker_image = hiera('tripleo::profile::pacemaker::manila::share_bundle::manila_share_docker_image', undef), $docker_volumes = [], $docker_environment = ['KOLLA_CONFIG_STRATEGY=COPY_ALWAYS'], - $backend_cephfs_enabled = hiera('manila_backend_cephfs_enabled', false), + $ceph_nfs_enabled = hiera('ceph_nfs_enabled', false), $container_backend = 'docker', $pcs_tries = hiera('pcs_tries', 20), $step = Integer(hiera('step')), @@ -92,7 +88,6 @@ class tripleo::profile::pacemaker::manila::share_bundle ( $manila_share_nodes_count = count(hiera('manila_share_short_node_names', [])) $manila_cephfs_protocol_helper_type = hiera('manila::backend::cephfs::cephfs_protocol_helper_type', '') - $nfs_ganesha = ($backend_cephfs_enabled and $manila_cephfs_protocol_helper_type == 'NFS') $docker_vol_arr = delete(any2array($docker_volumes), '').flatten() unless empty($docker_vol_arr) { @@ -182,7 +177,7 @@ class tripleo::profile::pacemaker::manila::share_bundle ( # creation of NFS exports and DBus socket has to be mounted # both to manila-share and ganesha containers so they can talk # to each other - if $nfs_ganesha { + if $ceph_nfs_enabled { $extra_storage_maps = { 'manila-share-dbus-docker' => { 'source-dir' => '/var/run/dbus/system_bus_socket', @@ -220,7 +215,7 @@ class tripleo::profile::pacemaker::manila::share_bundle ( container_backend => $container_backend, } - if $nfs_ganesha { + if $ceph_nfs_enabled { pacemaker::constraint::order { 'ceph-nfs-then-manila-share': first_resource => 'ceph-nfs', second_resource => 'openstack-manila-share', diff --git a/spec/classes/tripleo_profile_pacemaker_manila_share_bundle_spec.rb b/spec/classes/tripleo_profile_pacemaker_manila_share_bundle_spec.rb index fd4441b31..3ca13fc07 100644 --- a/spec/classes/tripleo_profile_pacemaker_manila_share_bundle_spec.rb +++ b/spec/classes/tripleo_profile_pacemaker_manila_share_bundle_spec.rb @@ -72,20 +72,20 @@ describe 'tripleo::profile::pacemaker::manila::share_bundle' do storage_maps = catalogue.resource( 'Pacemaker::Resource::Bundle', 'openstack-manila-share').send(:parameters)[:storage_maps] expect(storage_maps).to include('manila-share-cfg-files', 'manila-share-cfg-data') - # CephFS is disabled by default, so ensure no resources are created. + # ceph-nfs is disabled by default, so ensure no resources are created. is_expected.to_not contain_pacemaker__constraint__order('ceph-nfs-then-manila-share') is_expected.to_not contain_pacemaker__constraint__colocation('openstack-manila-share-with-ceph-nfs') expect(storage_maps).to_not include('manila-share-dbus-docker', 'manila-share-etc-ganesha') end end - context 'with cephfs backend enabled' do + context 'with ceph-nfs enabled' do before :each do params.merge!({ - :backend_cephfs_enabled => true, + :ceph_nfs_enabled => true, }) end - it 'should include cephfs docker volumes and pacemaker constraints' do + it 'should include ceph-nfs docker volumes and pacemaker constraints' do is_expected.to contain_pacemaker__constraint__order('ceph-nfs-then-manila-share') is_expected.to contain_pacemaker__constraint__colocation('openstack-manila-share-with-ceph-nfs') storage_maps = catalogue.resource(