假设我有一个模块files/etc/foo/{conf0, conf1, conf2, conf3, etc}
。当文件数量很少时,放置每个文件非常简单:
file { 'conf0':
path => '/etc/foo/conf0',
ensure => true,
source => 'puppet:///.../etc/foo/conf0',
}
并重复。但是涉及到很多重复,如果有多个配置文件,要进行维护很繁琐。我想确保将files/etc/foo/
其镜像到给定的路径。也就是说,
file { 'etc foo confs':
path => '/etc/foo',
ensure => recursive,
source => 'puppet:///.../etc/foo',
}
将创建/etc/foo/conf0
,/etc/foo/conf1
依此类推。这可能吗?