木偶文件 URL 指向'Name or service not known'



/etc/puppetlabs/code/modules/send/manifest/init.pp

class send {
  file { '/tmp/hello.txt':
  owner  => 'root',
  group  => 'root',
  mode   => '0644',
  source => 'puppet://modules/send/hello.txt',
  }
}
在/etc/puppetlabs/code/modules/send/files/hello.txt

puppet agent -t报告

[root@consul-test-02 tmp]# puppet agent -t
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Caching catalog for consul-test-02
Info: Applying configuration version '1438919627'
Error: /Stage[main]/Send/File[/tmp/hello.txt]: Could not evaluate: Could not retrieve file metadata for puppet://modules/send/hello.txt: getaddrinfo: Name or service not known
Notice: Applied catalog in 0.03 seconds

您的URL缺少斜杠。使用

source => 'puppet:///modules/send/hello.txt',

注意三个斜杠。您的URL有puppet://modules/...,所以它有modules主机部分,这(幸运的是)不解析到您的环境中的地址。

相关内容

最新更新