简体   繁体   中英

Puppet file resource not resolving the source attribute

I have started to play with puppet 5 and for some reason the source attribute in the puppet file resource is not working. I have a simple manifest file in my puppet server which is as follows:

file {'/tmp/motd':
  source => '/tmp/motd',
}

On the agent, I issue:

puppet agent -t

which errors out as:

Error: /Stage[main]/Main/File[/tmp/motd]: Could not evaluate: Could not retrieve information from environment production source(s) file:/tmp/motd

The file motd exists on the puppet server in /tmp/ directory

Any idea what might be going on here?

If I replace source attribute with content => 'Testing 1 2 3' , the puppet agent -t runs successfully creating a catalogue and I see the file motd on the client with the content Testing 1 2 3

As explained in the docs here , the source attribute refers to a local file, ie local on the Puppet Agent node.

If you wish to source the file from the Puppet Server, it would be best to place the file content in the module's files directory as explained here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM