Skip to content

Commit 30088f2

Browse files
committed
Replace hostname with networking.hostname
1 parent 0614dff commit 30088f2

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-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: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
let(:facts) do
1616
facts.merge(root_home: '/root',
1717
fqdn: 'myhost.mydomain',
18-
hostname: 'myhost')
18+
networking: {
19+
hostname: 'myhost'
20+
})
1921
end
2022

2123
['root@myhost.mydomain',
@@ -47,7 +49,9 @@
4749
let(:facts) do
4850
facts.merge(root_home: '/root',
4951
fqdn: 'localhost',
50-
hostname: 'localhost')
52+
networking: {
53+
hostname: 'localhost'
54+
})
5155
end
5256

5357
['root@127.0.0.1',
@@ -66,7 +70,9 @@
6670
let(:facts) do
6771
facts.merge(root_home: '/root',
6872
fqdn: 'localhost.localdomain',
69-
hostname: 'localhost')
73+
networking: {
74+
hostname: 'localhost'
75+
})
7076
end
7177

7278
['root@127.0.0.1',

0 commit comments

Comments
 (0)