Hello,
I am a puppet beginner and I'm looking for way to declare a file ressource that manages several files that again may come from different sources. The idea is to have a small manifest file where different files may come from a very particular source directory like for a hostname or a more general source directory with files specific to all hosts with eg a particular operation system:
This is the idea:
file { [ '/etc/nsswitch.conf',
'/etc/zypp/zypp.conf',
'/etc/cups/client.conf', ]:
owner => root,
group => root,
mode => 644,
source => [
'puppet:///modules/my-files/$::operatingsystem/$::lsbdistrelease', # source directories
'puppet:///modules/my-files/$::operatingsystem',
'puppet:///modules/my-files/$::hostname',
'puppet:///modules/my-files/$::osfamily',
],
}
So puppet:///modules/my-files/$::operatingsystem/$::lsbdistrelease is thought to be a directory that might contain the file "client.conf" in its subdirectory "etc/cups/" (i.e. puppet:///modules/my-files/$::operatingsystem/$::lsbdistrelease/etc/cups/client.conf). This way many files could managed in just one file ressource with the flexibility that a file could be specific to just one host or eg for all hosts with one operation system.
The manifest from above does not work, it results in directories beeing created instead files that should have been copied.
Is there a way to acive what I would like to do?
Thanks a lot
Rainer
↧