Hakmor
V2EX  ›  问与答

puppet 4.2 同步文件一个问题

  •  
  •   Hakmor · Aug 3, 2015 · 2320 views
    This topic created in 3957 days ago, the information mentioned may be changed or developed.

    在学习 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' : }
    
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3742 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 10:29 · PVG 18:29 · LAX 03:29 · JFK 06:29
    ♥ Do have faith in what you're doing.