Three things: first, I *think* the import lines would end up being
evaluated on the puppetmaster, and wouldn't use the clients' facts.
Second, I'm not sure you'd save any effort, and would be working against
the usual practice of "the files, templates, and manifests in my ntp
module tree are all I need to manage ntp on all the OSes I have to worry
about".
Third, you might be able to rework your case statements into selectors
and reduce the amount of repeated code that may be one cause for your
concerns (not knowing what's in your current case statements, it's hard
to say for sure). Here's an alternative that would work out pretty
compactly:
file { ntpconf:
path => "/etc/ntp.conf",
source => $operatingsystem ? {
"Debian" =>
"puppet:///ntp/ntp.conf.${lsbdistid}-${lsbdistcodename}",
"Solaris" => "puppet:///ntp/ntp.conf.Solaris"
},
owner => "root",
group => "root",
mode => 644,
}
Recent versions of facter on Ubuntu may return "Ubuntu" for the
operatingsystem fact instead of "Debian".
--
Mike Renfro / R&D Engineer, Center for Manufacturing Research,
931 372-3601 / Tennessee Technological University -- ren...@tntech.edu
$ facter facterversion lsbdistid
facterversion => 1.3.8
lsbdistid => Ubuntu
I think only case statements can take multiple values though, so:
case $lsbdistid {
Debian, Ubuntu: { $ntp_file_source =
"puppet:///ntp/ntp.conf.${lsbdistid}-${lsbdistcodename}",
Solaris: { $ntp_file_source = "puppet:///ntp/ntp.conf.Solaris" }
}
file { ntpconf:
...
source => "$ntp_file_source",
...
}