puppet-lintify
This commit is contained in:
parent
13d37b6a54
commit
a375035f2c
|
@ -192,19 +192,19 @@ class ff_gw::sysadmin::hostname($newname, $newip) {
|
||||||
$alias = regsubst($newname, '^([^.]*).*$', '\1')
|
$alias = regsubst($newname, '^([^.]*).*$', '\1')
|
||||||
|
|
||||||
# clean old names
|
# clean old names
|
||||||
if "$::hostname" != "$alias" {
|
if $::hostname != $alias {
|
||||||
host { "$hostname": ensure => absent }
|
host { $::hostname: ensure => absent }
|
||||||
}
|
}
|
||||||
if "$::fqdn" != "$newname" {
|
if $::fqdn != $newname {
|
||||||
host { "$fqdn": ensure => absent }
|
host { $::fqdn: ensure => absent }
|
||||||
}
|
}
|
||||||
|
|
||||||
# rewrite config files:
|
# rewrite config files:
|
||||||
host { "$newname":
|
host { $newname:
|
||||||
ensure => present,
|
ensure => present,
|
||||||
ip => $newip,
|
ip => $newip,
|
||||||
alias => $alias ? {
|
alias => $alias ? {
|
||||||
"$hostname" => undef,
|
$::hostname => undef,
|
||||||
default => $alias
|
default => $alias
|
||||||
},
|
},
|
||||||
before => Exec['hostname.sh'],
|
before => Exec['hostname.sh'],
|
||||||
|
@ -214,7 +214,7 @@ class ff_gw::sysadmin::hostname($newname, $newip) {
|
||||||
ensure => present,
|
ensure => present,
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
group => 'root',
|
group => 'root',
|
||||||
mode => 644,
|
mode => '0644',
|
||||||
content => "${newname}\n",
|
content => "${newname}\n",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -222,7 +222,7 @@ class ff_gw::sysadmin::hostname($newname, $newip) {
|
||||||
ensure => present,
|
ensure => present,
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
group => 'root',
|
group => 'root',
|
||||||
mode => 644,
|
mode => '0644',
|
||||||
content => "${newname}\n",
|
content => "${newname}\n",
|
||||||
notify => Exec['hostname.sh'],
|
notify => Exec['hostname.sh'],
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue