Skip to content

Commit f0a064a

Browse files
committed
Merge pull request #739 from hunner/dont_print_root
Dont print root
2 parents e3c9932 + f935962 commit f0a064a

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ spec/fixtures/
77
coverage/
88
.idea/
99
*.iml
10+
log/

manifests/server/root_password.pp

+18-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,24 @@
1212
}
1313

1414
if $mysql::server::create_root_my_cnf == true and $mysql::server::root_password != 'UNSET' {
15-
file { "${::root_home}/.my.cnf":
16-
content => template('mysql/my.cnf.pass.erb'),
17-
owner => 'root',
18-
mode => '0600',
15+
# Puppet 2.7 doesnt support show_diff
16+
if versioncmp($::puppetversion, '3.0') <= 0 {
17+
file { "${::root_home}/.my.cnf":
18+
content => template('mysql/my.cnf.pass.erb'),
19+
owner => 'root',
20+
mode => '0600',
21+
show_diff => false,
22+
}
23+
} else {
24+
file { "${::root_home}/.my.cnf":
25+
content => template('mysql/my.cnf.pass.erb'),
26+
owner => 'root',
27+
mode => '0600',
28+
}
29+
}
30+
# show_diff was added with puppet 3.0
31+
if versioncmp($::puppetversion, '3.0') <= 0 {
32+
File["${::root_home}/.my.cnf"] { show_diff => false }
1933
}
2034
if $mysql::server::create_root_user == true {
2135
Mysql_user['root@localhost'] -> File["${::root_home}/.my.cnf"]

0 commit comments

Comments
 (0)