Skip to content

Commit 8bf8903

Browse files
committed
Replace fqdn with networking.fqdn
1 parent 4b4f15d commit 8bf8903

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
end
2121

@@ -47,8 +47,8 @@
4747
context 'with fqdn==localhost' do
4848
let(:facts) do
4949
facts.merge(root_home: '/root',
50-
fqdn: 'localhost',
5150
netwoking: {
51+
fqdn: 'localhost',
5252
hostname: 'localhost'})
5353
end
5454

@@ -67,8 +67,8 @@
6767
context 'with fqdn==localhost.localdomain' do
6868
let(:facts) do
6969
facts.merge(root_home: '/root',
70-
fqdn: 'localhost.localdomain',
7170
netwoking: {
71+
fqdn: 'localhost.localdomain',
7272
hostname: 'localhost'})
7373
end
7474

0 commit comments

Comments
 (0)