adding deployment_type fact in support

We have added a deployment_type fact to indicate when puppet is being
executed within a container.

Change-Id: I5270778a7c4da2c383cf98c746b77c9b210e9ba0
Related-Bug: #1761624
(cherry picked from commit 2c7e877e58)
This commit is contained in:
David J Peacock 2018-09-26 12:24:34 -04:00 committed by David Peacock
parent a6eaab1406
commit 501f10c485
3 changed files with 24 additions and 2 deletions

View File

@ -67,7 +67,7 @@ class tripleo::fencing(
$all_devices = $config['devices']
if $::uuid != 'docker' {
if $::uuid != 'docker' and $::deployment_type != 'containers' {
$xvm_devices = local_fence_devices('fence_xvm', $all_devices)
create_resources('pacemaker::stonith::fence_xvm', $xvm_devices, $common_params)
}

View File

@ -82,7 +82,7 @@ class tripleo::profile::base::database::mysql::client (
# present in the base image but installed as a package afterwards),
# create it. We do not want to touch the permissions in case it already
# exists due to the mariadb server package being pre-installed
if $::uuid == 'docker' {
if $::uuid == 'docker' or $::deployment_type == 'containers' {
# When generating configuration with docker-puppet, services do
# not include any profile that would ensure creation of /etc/my.cnf.d,
# so we enforce the check here.

View File

@ -63,6 +63,28 @@ describe 'tripleo::profile::base::database::mysql::client' do
}
end
context 'with defaults with deployment_type' do
let (:params) do
{ :step => 1 }
end
before (:each) do
facts.merge!({ :uuid => 'notdocker', :deployment_type => 'containers' })
end
it {
is_expected.to contain_file('/etc/my.cnf.d').with(:ensure => 'directory')
is_expected.to contain_augeas('tripleo-mysql-client-conf').with(
:incl => '/etc/my.cnf.d/tripleo.cnf',
:changes => [
'rm tripleo/bind-address',
'rm tripleo/ssl',
'rm tripleo/ssl-ca'
]
)
}
end
context 'with ip address set to "" LP#1748180' do
let (:params) do
{ :step => 1,