Skip to content

Use $root_home for .my.cnf #214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 9, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
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,
Expand All @@ -196,7 +196,7 @@
}
}
} else {
file { '/root/.my.cnf':
file { "${root_home}/.my.cnf":
ensure => present,
}
}
Expand Down
8 changes: 4 additions & 4 deletions spec/classes/mysql_config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
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
Expand Down Expand Up @@ -290,7 +290,7 @@
describe 'when etc_root_password is set with password' do

let :facts do
{:osfamily => 'Debian'}
{:osfamily => 'Debian', :root_home => '/root'}
end

let :params do
Expand All @@ -313,7 +313,7 @@

describe 'setting etc_root_password should fail on redhat' do
let :facts do
{:osfamily => 'RedHat'}
{:osfamily => 'RedHat', :root_home => '/root'}
end

let :params do
Expand All @@ -328,7 +328,7 @@

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
Expand Down
8 changes: 4 additions & 4 deletions spec/classes/mysql_init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

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',
Expand All @@ -14,7 +14,7 @@

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',
Expand All @@ -24,7 +24,7 @@

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',
Expand All @@ -43,7 +43,7 @@

describe 'on any other os' do
let :facts do
{:osfamily => 'foo'}
{:osfamily => 'foo', :root_home => '/root'}
end

it 'should fail' do
Expand Down
8 changes: 4 additions & 4 deletions spec/classes/mysql_java_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

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',
Expand All @@ -14,7 +14,7 @@

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',
Expand All @@ -24,7 +24,7 @@

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',
Expand All @@ -43,7 +43,7 @@

describe 'on any other os' do
let :facts do
{:osfamily => 'foo'}
{:osfamily => 'foo', :root_home => '/root'}
end

it 'should fail' do
Expand Down
8 changes: 4 additions & 4 deletions spec/classes/mysql_perl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

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',
Expand All @@ -17,7 +17,7 @@

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',
Expand All @@ -28,7 +28,7 @@

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',
Expand All @@ -51,7 +51,7 @@

describe 'on any other os' do
let :facts do
{:osfamily => 'foo'}
{:osfamily => 'foo', :root_home => '/root'}
end

it 'should fail' do
Expand Down
8 changes: 4 additions & 4 deletions spec/classes/mysql_php_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

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',
Expand All @@ -14,7 +14,7 @@

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',
Expand All @@ -24,7 +24,7 @@

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',
Expand All @@ -43,7 +43,7 @@

describe 'on any other os' do
let :facts do
{:osfamily => 'foo'}
{:osfamily => 'foo', :root_home => '/root'}
end

it 'should fail' do
Expand Down
8 changes: 4 additions & 4 deletions spec/classes/mysql_python_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

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',
Expand All @@ -14,7 +14,7 @@

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',
Expand All @@ -24,7 +24,7 @@

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',
Expand All @@ -43,7 +43,7 @@

describe 'on any other os' do
let :facts do
{:osfamily => 'foo'}
{:osfamily => 'foo', :root_home => '/root'}
end

it 'should fail' do
Expand Down
8 changes: 4 additions & 4 deletions spec/classes/mysql_ruby_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

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',
Expand All @@ -17,7 +17,7 @@

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',
Expand All @@ -28,7 +28,7 @@

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',
Expand All @@ -51,7 +51,7 @@

describe 'on any other os' do
let :facts do
{:osfamily => 'foo'}
{:osfamily => 'foo', :root_home => '/root'}
end

it 'should fail' do
Expand Down
3 changes: 2 additions & 1 deletion spec/classes/mysql_server_account_security_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

let :facts do {
:fqdn => 'myhost.mydomain',
:hostname => 'myhost'
:hostname => 'myhost',
:root_home => '/root'
}
end

Expand Down
2 changes: 1 addition & 1 deletion spec/classes/mysql_server_monitor_spec.rb
Original file line number Diff line number Diff line change
@@ -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'"
Expand Down
3 changes: 2 additions & 1 deletion spec/classes/mysql_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
let :facts do
{ :osfamily => 'Debian',
:operatingsystem => 'Ubuntu',
:root_home => '/root'
}
end

Expand Down Expand Up @@ -44,7 +45,7 @@
describe "when osfamily is #{osfamily}" do

let :facts do
{ :osfamily => osfamily }
{ :osfamily => osfamily, :root_home => '/root' }
end

[
Expand Down
2 changes: 1 addition & 1 deletion spec/defines/mysql_server_config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
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') }
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/puppet/provider/database_grant/mysql_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
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(
Expand Down