Skip to content

Commit 4b4f15d

Browse files
committed
Replace hostname with networking.hostname
1 parent 0614dff commit 4b4f15d

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

manifests/params.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@
340340
$config_file = '/etc/my.cnf'
341341
$includedir = undef
342342
$datadir = '/var/mysql'
343-
$log_error = "/var/mysql/${::hostname}.err"
343+
$log_error = "/var/mysql/${facts['networking']['hostname']}.err"
344344
$pidfile = '/var/mysql/mysql.pid'
345345
$root_group = 'wheel'
346346
$mysql_group = '_mysql'

manifests/server/account_security.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
require => Anchor['mysql::server::end'],
2929
}
3030
}
31-
if ($::fqdn != $::hostname) {
32-
if ($::hostname != 'localhost') {
33-
mysql_user { ["root@${::hostname}", "@${::hostname}"]:
31+
if ($::fqdn != $facts['networking']['hostname']) {
32+
if ($facts['networking']['hostname'] != 'localhost') {
33+
mysql_user { ["root@${facts['networking']['hostname']}", "@${facts['networking']['hostname']}"]:
3434
ensure => 'absent',
3535
require => Anchor['mysql::server::end'],
3636
}

spec/classes/mysql_server_account_security_spec.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
let(:facts) do
1616
facts.merge(root_home: '/root',
1717
fqdn: 'myhost.mydomain',
18-
hostname: 'myhost')
18+
networking: {
19+
hostname: 'myhost'})
1920
end
2021

2122
['root@myhost.mydomain',
@@ -47,7 +48,8 @@
4748
let(:facts) do
4849
facts.merge(root_home: '/root',
4950
fqdn: 'localhost',
50-
hostname: 'localhost')
51+
netwoking: {
52+
hostname: 'localhost'})
5153
end
5254

5355
['root@127.0.0.1',
@@ -66,7 +68,8 @@
6668
let(:facts) do
6769
facts.merge(root_home: '/root',
6870
fqdn: 'localhost.localdomain',
69-
hostname: 'localhost')
71+
netwoking: {
72+
hostname: 'localhost'})
7073
end
7174

7275
['root@127.0.0.1',

0 commit comments

Comments
 (0)