Merge "MySQL Client: Remove logic for non-containerized deployment"
This commit is contained in:
commit
124ef70e0d
|
@ -81,30 +81,12 @@ class tripleo::profile::base::database::mysql::client (
|
||||||
|
|
||||||
$conf_changes = union($client_bind_changes, $changes_ssl)
|
$conf_changes = union($client_bind_changes, $changes_ssl)
|
||||||
|
|
||||||
# Create /etc/my.cnf.d/tripleo.cnf
|
# When generating configuration with docker-puppet, services do
|
||||||
# If the folder /etc/my.cnf.d does not exist (e.g. if mariadb is not
|
# not include any profile that would ensure creation of /etc/my.cnf.d,
|
||||||
# present in the base image but installed as a package afterwards),
|
# so we enforce the check here.
|
||||||
# create it. We do not want to touch the permissions in case it already
|
file {'/etc/my.cnf.d':
|
||||||
# exists due to the mariadb server package being pre-installed
|
ensure => 'directory'
|
||||||
if $::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.
|
|
||||||
file {'/etc/my.cnf.d':
|
|
||||||
ensure => 'directory'
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
# Otherwise, depending on the role, puppet may run this profile
|
|
||||||
# concurrently with the mysql profile, so we use an exec resource
|
|
||||||
# in order to avoid getting duplicate declaration errors
|
|
||||||
exec { 'directory-create-etc-my.cnf.d':
|
|
||||||
command => 'mkdir -p /etc/my.cnf.d',
|
|
||||||
unless => 'test -d /etc/my.cnf.d',
|
|
||||||
path => ['/usr/bin', '/usr/sbin', '/bin', '/sbin'],
|
|
||||||
before => Augeas['tripleo-mysql-client-conf']
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
file { $mysql_read_default_file:
|
file { $mysql_read_default_file:
|
||||||
ensure => file,
|
ensure => file,
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,61 +24,6 @@ describe 'tripleo::profile::base::database::mysql::client' do
|
||||||
{ :step => 1 }
|
{ :step => 1 }
|
||||||
end
|
end
|
||||||
|
|
||||||
before (:each) do
|
|
||||||
facts.merge!({ :deployment_type => 'notcontainers' })
|
|
||||||
end
|
|
||||||
|
|
||||||
it {
|
|
||||||
is_expected.to contain_exec('directory-create-etc-my.cnf.d')
|
|
||||||
is_expected.to contain_file('/etc/my.cnf.d/tripleo.cnf').with(
|
|
||||||
:ensure => 'file',
|
|
||||||
)
|
|
||||||
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',
|
|
||||||
'rm client/ssl',
|
|
||||||
'rm client/ssl-ca'
|
|
||||||
]
|
|
||||||
)
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'with defaults in containers' do
|
|
||||||
let (:params) do
|
|
||||||
{ :step => 1 }
|
|
||||||
end
|
|
||||||
|
|
||||||
before (:each) do
|
|
||||||
facts.merge!({ :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',
|
|
||||||
'rm client/ssl',
|
|
||||||
'rm client/ssl-ca'
|
|
||||||
]
|
|
||||||
)
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'with defaults with deployment_type' do
|
|
||||||
let (:params) do
|
|
||||||
{ :step => 1 }
|
|
||||||
end
|
|
||||||
|
|
||||||
before (:each) do
|
|
||||||
facts.merge!({ :deployment_type => 'notcontainers', :deployment_type => 'containers' })
|
|
||||||
end
|
|
||||||
|
|
||||||
it {
|
it {
|
||||||
is_expected.to contain_file('/etc/my.cnf.d').with(:ensure => 'directory')
|
is_expected.to contain_file('/etc/my.cnf.d').with(:ensure => 'directory')
|
||||||
is_expected.to contain_augeas('tripleo-mysql-client-conf').with(
|
is_expected.to contain_augeas('tripleo-mysql-client-conf').with(
|
||||||
|
@ -101,12 +46,8 @@ describe 'tripleo::profile::base::database::mysql::client' do
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
before (:each) do
|
|
||||||
facts.merge!({ :deployment_type => 'notcontainers' })
|
|
||||||
end
|
|
||||||
|
|
||||||
it {
|
it {
|
||||||
is_expected.to contain_exec('directory-create-etc-my.cnf.d')
|
is_expected.to contain_file('/etc/my.cnf.d').with(:ensure => 'directory')
|
||||||
is_expected.to contain_augeas('tripleo-mysql-client-conf').with(
|
is_expected.to contain_augeas('tripleo-mysql-client-conf').with(
|
||||||
:incl => '/etc/my.cnf.d/tripleo.cnf',
|
:incl => '/etc/my.cnf.d/tripleo.cnf',
|
||||||
:changes => [
|
:changes => [
|
||||||
|
@ -128,12 +69,8 @@ describe 'tripleo::profile::base::database::mysql::client' do
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
before (:each) do
|
|
||||||
facts.merge!({ :deployment_type => 'notcontainers' })
|
|
||||||
end
|
|
||||||
|
|
||||||
it {
|
it {
|
||||||
is_expected.to contain_exec('directory-create-etc-my.cnf.d')
|
is_expected.to contain_file('/etc/my.cnf.d').with(:ensure => 'directory')
|
||||||
is_expected.to contain_augeas('tripleo-mysql-client-conf').with(
|
is_expected.to contain_augeas('tripleo-mysql-client-conf').with(
|
||||||
:incl => '/etc/my.cnf.d/tripleo.cnf',
|
:incl => '/etc/my.cnf.d/tripleo.cnf',
|
||||||
:changes => [
|
:changes => [
|
||||||
|
|
Loading…
Reference in New Issue