We're using Foreman to manage puppet. I'm trying to create a class that uses the default value of $::domain, for $dhcp_dnsdomain, unless the parameter is defined as a host parameter within Foreman. For example:
class foreman_proxy (
$dhcp_dnsdomain = $::domain,
$nameservers = ['10.0.0.1',],
) {
file { "/path/to/file":
ensure => present,
mode => '0755',
content => template("foreman_proxy/mytemplate.erb"),
}
}
I'd like $dhcp_dnsdomain to default to the host's facter value of $::domain if no host parameter is specified in Foreman. If $dhcp_dnsdomain is given in Foreman, I want that to be used instead of the default.
In the example above, I'm unable to override $dhcp_dnsdomain by setting the corresponding value on the host in Foreman. It always goes with the value of $::domain.
Is there a way to do this?