puppet 4.2 同步文件一个问题

2015-08-03 15:59:04 +08:00
 Hakmor

在学习 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' : }
1531 次点击
所在节点    问与答
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/210470

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX