Hi Guys,
I am using foreman and puppet to provision/manage systems. I have a simple motd module that I was using for all my systems but now have a need to setup a different motd for a specific hostgroup/type of systems. So, I though I would use the hostgroup hiera setup from foreman/puppet to decide which motd to use. I wrote something quickly to test but have unexpected results and was hoping someone here can help me make sense of this:
--
my hostgroup for system 1 is CSOE73_Prod/hpc/misc and for system 2 is CSOE73_Prod/hpc/compute. So I decided to write the code this way:
if [$hostgroup == 'CSOE73_Prod/hpc/misc'] {
file { "/etc/motd":
ensure => file,
content => template('clientos/motd.erb')
}
}
else {
file { "/etc/motd":
ensure => file,
source => 'puppet:///modules/clientos/etc/motd',
mode => 644,
owner => 'root',
group => 'root',
}
}
--
However, for both systems the motd.erb template is being applied. However, my expectation was that for system 2 it would just use the files/etc/motd file. Is it maybe the backslash in CSOE73_Prod/hpc/misc that might be throwing it off? Am I going about this totally the wrong way?
Any help would be greatly appreciated!
Thanks,
-J