Merge pull request #214 from paramite/roothome

Use $root_home for .my.cnf
This commit is contained in:
Ashley Penney 2013-07-09 16:04:23 -07:00
commit 9bc2eb67c7
13 changed files with 37 additions and 35 deletions

View file

@ -183,7 +183,7 @@ class mysql::config(
require => File['/etc/mysql/conf.d'],
}
file { '/root/.my.cnf':
file { "${root_home}/.my.cnf":
content => template('mysql/my.cnf.pass.erb'),
require => Exec['set_mysql_rootpw'],
notify => undef,
@ -196,7 +196,7 @@ class mysql::config(
}
}
} else {
file { '/root/.my.cnf':
file { "${root_home}/.my.cnf":
ensure => present,
}
}

View file

@ -77,7 +77,7 @@ describe 'mysql::config' do
describe "when osfamily is #{osfamily}" do
let :facts do
{:osfamily => osfamily}
{:osfamily => osfamily, :root_home => '/root'}
end
describe 'when config file should be managed' do
@ -290,7 +290,7 @@ describe 'mysql::config' do
describe 'when etc_root_password is set with password' do
let :facts do
{:osfamily => 'Debian'}
{:osfamily => 'Debian', :root_home => '/root'}
end
let :params do
@ -313,7 +313,7 @@ describe 'mysql::config' do
describe 'setting etc_root_password should fail on redhat' do
let :facts do
{:osfamily => 'RedHat'}
{:osfamily => 'RedHat', :root_home => '/root'}
end
let :params do
@ -328,7 +328,7 @@ describe 'mysql::config' do
describe 'unset ssl params should fail when ssl is true on freebsd' do
let :facts do
{:osfamily => 'FreeBSD'}
{:osfamily => 'FreeBSD', :root_home => '/root'}
end
let :params do

View file

@ -4,7 +4,7 @@ describe 'mysql' do
describe 'on a debian based os' do
let :facts do
{ :osfamily => 'Debian'}
{ :osfamily => 'Debian', :root_home => '/root'}
end
it { should contain_package('mysql_client').with(
:name => 'mysql-client',
@ -14,7 +14,7 @@ describe 'mysql' do
describe 'on a freebsd based os' do
let :facts do
{ :osfamily => 'FreeBSD'}
{ :osfamily => 'FreeBSD', :root_home => '/root'}
end
it { should contain_package('mysql_client').with(
:name => 'databases/mysql55-client',
@ -24,7 +24,7 @@ describe 'mysql' do
describe 'on a redhat based os' do
let :facts do
{:osfamily => 'RedHat'}
{:osfamily => 'RedHat', :root_home => '/root'}
end
it { should contain_package('mysql_client').with(
:name => 'mysql',
@ -43,7 +43,7 @@ describe 'mysql' do
describe 'on any other os' do
let :facts do
{:osfamily => 'foo'}
{:osfamily => 'foo', :root_home => '/root'}
end
it 'should fail' do

View file

@ -4,7 +4,7 @@ describe 'mysql::java' do
describe 'on a debian based os' do
let :facts do
{ :osfamily => 'Debian'}
{ :osfamily => 'Debian', :root_home => '/root'}
end
it { should contain_package('mysql-connector-java').with(
:name => 'libmysql-java',
@ -14,7 +14,7 @@ describe 'mysql::java' do
describe 'on a freebsd based os' do
let :facts do
{ :osfamily => 'FreeBSD'}
{ :osfamily => 'FreeBSD', :root_home => '/root'}
end
it { should contain_package('mysql-connector-java').with(
:name => 'databases/mysql-connector-java',
@ -24,7 +24,7 @@ describe 'mysql::java' do
describe 'on a redhat based os' do
let :facts do
{:osfamily => 'RedHat'}
{:osfamily => 'RedHat', :root_home => '/root'}
end
it { should contain_package('mysql-connector-java').with(
:name => 'mysql-connector-java',
@ -43,7 +43,7 @@ describe 'mysql::java' do
describe 'on any other os' do
let :facts do
{:osfamily => 'foo'}
{:osfamily => 'foo', :root_home => '/root'}
end
it 'should fail' do

View file

@ -4,7 +4,7 @@ describe 'mysql::perl' do
describe 'on a debian based os' do
let :facts do
{ :osfamily => 'Debian'}
{ :osfamily => 'Debian', :root_home => '/root'}
end
it { should contain_package('perl_mysql').with(
:name => 'libdbd-mysql-perl',
@ -17,7 +17,7 @@ describe 'mysql::perl' do
describe 'on a freebsd based os' do
let :facts do
{ :osfamily => 'FreeBSD'}
{ :osfamily => 'FreeBSD', :root_home => '/root'}
end
it { should contain_package('perl_mysql').with(
:name => 'p5-DBD-mysql',
@ -28,7 +28,7 @@ describe 'mysql::perl' do
describe 'on a redhat based os' do
let :facts do
{:osfamily => 'Redhat'}
{:osfamily => 'Redhat', :root_home => '/root'}
end
it { should contain_package('perl_mysql').with(
:name => 'perl-DBD-MySQL',
@ -51,7 +51,7 @@ describe 'mysql::perl' do
describe 'on any other os' do
let :facts do
{:osfamily => 'foo'}
{:osfamily => 'foo', :root_home => '/root'}
end
it 'should fail' do

View file

@ -4,7 +4,7 @@ describe 'mysql::php' do
describe 'on a debian based os' do
let :facts do
{ :osfamily => 'Debian'}
{ :osfamily => 'Debian', :root_home => '/root'}
end
it { should contain_package('php-mysql').with(
:name => 'php5-mysql',
@ -14,7 +14,7 @@ describe 'mysql::php' do
describe 'on a freebsd based os' do
let :facts do
{ :osfamily => 'FreeBSD'}
{ :osfamily => 'FreeBSD', :root_home => '/root'}
end
it { should contain_package('php-mysql').with(
:name => 'php5-mysql',
@ -24,7 +24,7 @@ describe 'mysql::php' do
describe 'on a redhat based os' do
let :facts do
{:osfamily => 'Redhat'}
{:osfamily => 'Redhat', :root_home => '/root'}
end
it { should contain_package('php-mysql').with(
:name => 'php-mysql',
@ -43,7 +43,7 @@ describe 'mysql::php' do
describe 'on any other os' do
let :facts do
{:osfamily => 'foo'}
{:osfamily => 'foo', :root_home => '/root'}
end
it 'should fail' do

View file

@ -4,7 +4,7 @@ describe 'mysql::python' do
describe 'on a debian based os' do
let :facts do
{ :osfamily => 'Debian'}
{ :osfamily => 'Debian', :root_home => '/root'}
end
it { should contain_package('python-mysqldb').with(
:name => 'python-mysqldb',
@ -14,7 +14,7 @@ describe 'mysql::python' do
describe 'on a freebsd based os' do
let :facts do
{ :osfamily => 'FreeBSD'}
{ :osfamily => 'FreeBSD', :root_home => '/root'}
end
it { should contain_package('python-mysqldb').with(
:name => 'databases/py-MySQLdb',
@ -24,7 +24,7 @@ describe 'mysql::python' do
describe 'on a redhat based os' do
let :facts do
{:osfamily => 'RedHat'}
{:osfamily => 'RedHat', :root_home => '/root'}
end
it { should contain_package('python-mysqldb').with(
:name => 'MySQL-python',
@ -43,7 +43,7 @@ describe 'mysql::python' do
describe 'on any other os' do
let :facts do
{:osfamily => 'foo'}
{:osfamily => 'foo', :root_home => '/root'}
end
it 'should fail' do

View file

@ -4,7 +4,7 @@ describe 'mysql::ruby' do
describe 'on a debian based os' do
let :facts do
{ :osfamily => 'Debian'}
{ :osfamily => 'Debian', :root_home => '/root'}
end
it { should contain_package('ruby_mysql').with(
:name => 'libmysql-ruby',
@ -17,7 +17,7 @@ describe 'mysql::ruby' do
describe 'on a freebsd based os' do
let :facts do
{ :osfamily => 'FreeBSD'}
{ :osfamily => 'FreeBSD', :root_home => '/root'}
end
it { should contain_package('ruby_mysql').with(
:name => 'ruby-mysql',
@ -28,7 +28,7 @@ describe 'mysql::ruby' do
describe 'on a redhat based os' do
let :facts do
{:osfamily => 'RedHat'}
{:osfamily => 'RedHat', :root_home => '/root'}
end
it { should contain_package('ruby_mysql').with(
:name => 'ruby-mysql',
@ -51,7 +51,7 @@ describe 'mysql::ruby' do
describe 'on any other os' do
let :facts do
{:osfamily => 'foo'}
{:osfamily => 'foo', :root_home => '/root'}
end
it 'should fail' do

View file

@ -4,7 +4,8 @@ describe 'mysql::server::account_security' do
let :facts do {
:fqdn => 'myhost.mydomain',
:hostname => 'myhost'
:hostname => 'myhost',
:root_home => '/root'
}
end

View file

@ -1,7 +1,7 @@
require 'spec_helper'
describe 'mysql::server::monitor' do
let :facts do
{ :osfamily => 'Debian' }
{ :osfamily => 'Debian', :root_home => '/root' }
end
let :pre_condition do
"include 'mysql::server'"

View file

@ -13,6 +13,7 @@ describe 'mysql::server' do
let :facts do
{ :osfamily => 'Debian',
:operatingsystem => 'Ubuntu',
:root_home => '/root'
}
end
@ -44,7 +45,7 @@ describe 'mysql::server' do
describe "when osfamily is #{osfamily}" do
let :facts do
{ :osfamily => osfamily }
{ :osfamily => osfamily, :root_home => '/root' }
end
[

View file

@ -4,7 +4,7 @@ describe 'mysql::server::config', :type => :define do
filename = '/etc/mysql/conf.d/test_config.cnf'
let :facts do
{ :osfamily => 'Debian'}
{ :osfamily => 'Debian', :root_home => '/root'}
end
let(:title) { File.basename(filename, '.cnf') }

View file

@ -6,7 +6,7 @@ RSpec.configure do |config|
end
provider_class = Puppet::Type.type(:database_grant).provider(:mysql)
describe provider_class do
let(:root_home) { '/some/root/home' }
let(:root_home) { '/root' }
before :each do
@resource = Puppet::Type::Database_grant.new(