Add a name resolution facility for hostnames
Make sure that hosts can always resolve each other's names. For the moment, this simply uses exported /etc/hosts entries. Less naive implementations could just export the address/hostname tuples and feed them into a DNS server configuration.
This commit is contained in:
parent
951ae08f0b
commit
3cc5e2e928
@ -18,6 +18,7 @@
|
|||||||
class kickstack (
|
class kickstack (
|
||||||
$fact_prefix = $kickstack::params::fact_prefix,
|
$fact_prefix = $kickstack::params::fact_prefix,
|
||||||
$fact_filename = $kickstack::params::fact_filename,
|
$fact_filename = $kickstack::params::fact_filename,
|
||||||
|
$name_resolution = $kickstack::params::name_resolution,
|
||||||
$verbose = $kickstack::params::verbose,
|
$verbose = $kickstack::params::verbose,
|
||||||
$debug = $kickstack::params::debug,
|
$debug = $kickstack::params::debug,
|
||||||
$database = $kickstack::params::database,
|
$database = $kickstack::params::database,
|
||||||
@ -57,4 +58,5 @@ class kickstack (
|
|||||||
|
|
||||||
include exportfact
|
include exportfact
|
||||||
include openstack::repo
|
include openstack::repo
|
||||||
|
include kickstack::nameresolution
|
||||||
}
|
}
|
||||||
|
16
manifests/nameresolution.pp
Normal file
16
manifests/nameresolution.pp
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
class kickstack::nameresolution inherits kickstack {
|
||||||
|
|
||||||
|
case $::kickstack::name_resolution {
|
||||||
|
'hosts': {
|
||||||
|
|
||||||
|
@@host { "$hostname":
|
||||||
|
ip => $ipaddress,
|
||||||
|
comment => "Managed by Puppet",
|
||||||
|
tag => "hostname"
|
||||||
|
}
|
||||||
|
|
||||||
|
Host <<| tag == "hostname" |>> { }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -12,6 +12,11 @@ class kickstack::params {
|
|||||||
# * override by setting "kickstack_fact_category"
|
# * override by setting "kickstack_fact_category"
|
||||||
$fact_category = pick(getvar("::${variable_prefix}fact_category"), "kickstack")
|
$fact_category = pick(getvar("::${variable_prefix}fact_category"), "kickstack")
|
||||||
|
|
||||||
|
# The strategy to use so machines can make their hostnames known to
|
||||||
|
# each other.
|
||||||
|
# * default "hosts" -- manage /etc/hosts
|
||||||
|
$name_resolution = pick(getvar("::${variable_prefix}name_resolution"),"hosts")
|
||||||
|
|
||||||
# Enables verbose logging globally
|
# Enables verbose logging globally
|
||||||
$verbose = str2bool(pick(getvar("::${variable_prefix}verbose"), 'false'))
|
$verbose = str2bool(pick(getvar("::${variable_prefix}verbose"), 'false'))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user