Skip to content

Commit 6ae6076

Browse files
committed
Replace fqdn with networking.fqdn
1 parent 30088f2 commit 6ae6076

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

manifests/server/account_security.pp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,23 @@
1212
ensure => 'absent',
1313
require => Anchor['mysql::server::end'],
1414
}
15-
if ($::fqdn != 'localhost.localdomain') {
15+
if ($facts['networking']['fqdn'] != 'localhost.localdomain') {
1616
mysql_user {
1717
['root@localhost.localdomain',
1818
'@localhost.localdomain']:
1919
ensure => 'absent',
2020
require => Anchor['mysql::server::end'],
2121
}
2222
}
23-
if ($::fqdn and $::fqdn != 'localhost') {
23+
if ($facts['networking']['fqdn'] and $facts['networking']['fqdn'] != 'localhost') {
2424
mysql_user {
25-
["root@${::fqdn}",
26-
"@${::fqdn}"]:
25+
["root@${facts['networking']['fqdn']}",
26+
"@${facts['networking']['fqdn']}"]:
2727
ensure => 'absent',
2828
require => Anchor['mysql::server::end'],
2929
}
3030
}
31-
if ($::fqdn != $facts['networking']['hostname']) {
31+
if ($facts['networking']['fqdn'] != $facts['networking']['hostname']) {
3232
if ($facts['networking']['hostname'] != 'localhost') {
3333
mysql_user { ["root@${facts['networking']['hostname']}", "@${facts['networking']['hostname']}"]:
3434
ensure => 'absent',

spec/classes/mysql_server_account_security_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
context 'with fqdn==myhost.mydomain' do
1515
let(:facts) do
1616
facts.merge(root_home: '/root',
17-
fqdn: 'myhost.mydomain',
1817
networking: {
18+
fqdn: 'myhost.mydomain',
1919
hostname: 'myhost'
2020
})
2121
end
@@ -48,8 +48,8 @@
4848
context 'with fqdn==localhost' do
4949
let(:facts) do
5050
facts.merge(root_home: '/root',
51-
fqdn: 'localhost',
5251
networking: {
52+
fqdn: 'localhost',
5353
hostname: 'localhost'
5454
})
5555
end
@@ -69,8 +69,8 @@
6969
context 'with fqdn==localhost.localdomain' do
7070
let(:facts) do
7171
facts.merge(root_home: '/root',
72-
fqdn: 'localhost.localdomain',
7372
networking: {
73+
fqdn: 'localhost.localdomain',
7474
hostname: 'localhost'
7575
})
7676
end

0 commit comments

Comments
 (0)