Merge "Allow external Ganesha for the cephfs manila backend"

This commit is contained in:
Zuul 2019-06-04 14:06:36 +00:00 committed by Gerrit Code Review
commit 19e45beb97
2 changed files with 10 additions and 15 deletions

View File

@ -18,9 +18,9 @@
# #
# === Parameters # === Parameters
# #
# [*backend_cephfs_enabled*] # [*ceph_nfs_enabled*]
# (Optional) Whether or not the cephfs backend is enabled # (Optional) Whether or not the ceph_nfs service is enabled
# Defaults to hiera('manila_backend_cephfs_enabled', false) # Defaults to hiera('ceph_nfs_enabled', false)
# #
# [*manila_share_docker_image*] # [*manila_share_docker_image*]
# (Optional) The docker image to use for creating the pacemaker bundle # (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 # (Optional) The list of environment variables set in the docker container
# Defaults to ['KOLLA_CONFIG_STRATEGY=COPY_ALWAYS'] # 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*] # [*pcs_tries*]
# (Optional) The number of times pcs commands should be retried. # (Optional) The number of times pcs commands should be retried.
# Defaults to hiera('pcs_tries', 20) # 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), $manila_share_docker_image = hiera('tripleo::profile::pacemaker::manila::share_bundle::manila_share_docker_image', undef),
$docker_volumes = [], $docker_volumes = [],
$docker_environment = ['KOLLA_CONFIG_STRATEGY=COPY_ALWAYS'], $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', $container_backend = 'docker',
$pcs_tries = hiera('pcs_tries', 20), $pcs_tries = hiera('pcs_tries', 20),
$step = Integer(hiera('step')), $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_share_nodes_count = count(hiera('manila_share_short_node_names', []))
$manila_cephfs_protocol_helper_type = hiera('manila::backend::cephfs::cephfs_protocol_helper_type', '') $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() $docker_vol_arr = delete(any2array($docker_volumes), '').flatten()
unless empty($docker_vol_arr) { 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 # creation of NFS exports and DBus socket has to be mounted
# both to manila-share and ganesha containers so they can talk # both to manila-share and ganesha containers so they can talk
# to each other # to each other
if $nfs_ganesha { if $ceph_nfs_enabled {
$extra_storage_maps = { $extra_storage_maps = {
'manila-share-dbus-docker' => { 'manila-share-dbus-docker' => {
'source-dir' => '/var/run/dbus/system_bus_socket', 'source-dir' => '/var/run/dbus/system_bus_socket',
@ -220,7 +215,7 @@ class tripleo::profile::pacemaker::manila::share_bundle (
container_backend => $container_backend, container_backend => $container_backend,
} }
if $nfs_ganesha { if $ceph_nfs_enabled {
pacemaker::constraint::order { 'ceph-nfs-then-manila-share': pacemaker::constraint::order { 'ceph-nfs-then-manila-share':
first_resource => 'ceph-nfs', first_resource => 'ceph-nfs',
second_resource => 'openstack-manila-share', second_resource => 'openstack-manila-share',

View File

@ -72,20 +72,20 @@ describe 'tripleo::profile::pacemaker::manila::share_bundle' do
storage_maps = catalogue.resource( storage_maps = catalogue.resource(
'Pacemaker::Resource::Bundle', 'openstack-manila-share').send(:parameters)[:storage_maps] 'Pacemaker::Resource::Bundle', 'openstack-manila-share').send(:parameters)[:storage_maps]
expect(storage_maps).to include('manila-share-cfg-files', 'manila-share-cfg-data') 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__order('ceph-nfs-then-manila-share')
is_expected.to_not contain_pacemaker__constraint__colocation('openstack-manila-share-with-ceph-nfs') 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') expect(storage_maps).to_not include('manila-share-dbus-docker', 'manila-share-etc-ganesha')
end end
end end
context 'with cephfs backend enabled' do context 'with ceph-nfs enabled' do
before :each do before :each do
params.merge!({ params.merge!({
:backend_cephfs_enabled => true, :ceph_nfs_enabled => true,
}) })
end 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__order('ceph-nfs-then-manila-share')
is_expected.to contain_pacemaker__constraint__colocation('openstack-manila-share-with-ceph-nfs') is_expected.to contain_pacemaker__constraint__colocation('openstack-manila-share-with-ceph-nfs')
storage_maps = catalogue.resource( storage_maps = catalogue.resource(