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

puppet 4.2 同步文件一个问题

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

    在学习 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   ·   实用小工具   ·   5583 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 02:23 · PVG 10:23 · LAX 18:23 · JFK 21:23
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.