Puppet Class: ipa::client::deploy
- Defined in:
- manifests/client/deploy.pp
Overview
NOTE: use this to deploy all the @@ipa::client::* exported resources on clients the $nametag variable should match the $name value of the server/client::host
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'manifests/client/deploy.pp', line 20
class ipa::client::deploy(
$hostname = $::hostname,
$domain = $::domain,
$server = '',
$nametag = '', # pick a tag to collect...
$debug = false
) {
$valid_domain = downcase($domain) # TODO: validate ?
# if $hostname has dots, then assume it's a fqdn, if not, we add $domain
$valid_fqdn = delete("${hostname}", '.') ? {
"${hostname}" => "${hostname}.${valid_domain}", # had no dots present
default => "${hostname}", # had dots present...
}
# NOTE: the resource collects by fqdn; one good reason to use the fqdn!
# sure you can override this by choosing your own $name value, but why?
$valid_tag = "${nametag}" ? {
'' => "${valid_fqdn}",
default => "${nametag}",
}
# TODO: if i had more than one arg to decide to override, then i would
# have to build a big tree of nested choices... this is one more place
# where puppet shows it's really not a mature language yet. oh well...
# the host field is also the argument passed to the exported resource,
# and it is the $valid_host variable that came from the server service
if "${server}" == '' {
Ipa::Client::Host <<| tag == "${valid_tag}" |>> {
debug => $debug,
}
Ipa::Client::Service <<| host == "${valid_tag}" |>> {
debug => $debug,
}
} else {
Ipa::Client::Host <<| tag == "${valid_tag}" |>> {
server => "${server}", # override...
debug => $debug,
}
Ipa::Client::Service <<| host == "${valid_tag}" |>> {
server => "${server}", # override...
debug => $debug,
}
}
}
|