在学习 puppet 4.2,写了一个 hello 模块,将 master 下的 /etc/puppetlabs/code/environments/production/modules/hello/files/hello.txt
下的文件同步在
agent 的 /tmp/hello.txt
报的错误是
Info: Retrieving pluginfacts Info: Retrieving plugin Info: Caching catalog for vm22796 Info: Applying configuration version '1438588739' Error: /Stage[main]/Hello/File[hello]: Could not evaluate: Could not retrieve file metadata for puppet://modules/hello/hello.txt: getaddrinfo: Name or service not known Notice: File has been created. Notice: /Stage[main]/Hello/Notify[File has been created.]/message: defined 'message' as 'File has been created.' Info: Class[Hello]: Unscheduling all events on Class[Hello] Notice: Applied catalog in 2.08 seconds
我的代码是这样写的
class hello { file { 'hello': mode => '0640', path => '/tmp/hello.txt', source => "puppet://modules/hello/hello.txt", } notify { "File has been created." : } } class { 'hello' : }