我试图将位于puppet master的文件夹/vagrant/scripts及其子文件夹复制到代理中。 我在init.pp使用以下configuration:
file { '/home/vagrant/scripts': ensure => 'file', source => 'puppet:///modules/ycsb/scripts', path => '/home/vagrant/YCSB/scripts', owner => 'vagrant', group => 'vagrant', mode => '0744', # Use 0700 if it is sensitive }
当我检查代理我可以看到/scripts文件夹,但没有其子文件夹。 任何想法为什么发生这种情况
我刚刚发现了这个问题。 首先,不要使用'文件'来确保参数。 其次,使复制过程recursion包含所有的子文件夹。
file { '/home/vagrant/scripts': ensure => 'directory', source => 'puppet:///modules/ycsb/scripts', recurse => 'remote', path => '/home/vagrant/YCSB/scripts', owner => 'vagrant', group => 'vagrant', mode => '0744', # Use 0700 if it is sensitive }