V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
Hakmor
V2EX  ›  问与答

puppet 4.2 同步文件一个问题

  •  
  •   Hakmor · 2015-08-03 15:59:04 +08:00 · 1516 次点击
    这是一个创建于 3191 天前的主题,其中的信息可能已经有所发展或是发生改变。

    在学习 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' : }
    
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5370 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 08:21 · PVG 16:21 · LAX 01:21 · JFK 04:21
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.