0
votes

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

1

1 Answers

0
votes

As explained in the docs here, the source attribute refers to a local file, i.e. 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.