I am trying to copy files using file resource . My code is as follows:
node 'Node-002' {
file { "/root/helloworld.txt":
ensure => file,
owner => "root",
group => "root",
mode => "0644",
source => "puppet://modules/templates/${fqdn}/hosts.erb",
}
}
But it is failing with the following error
Error: /Stage[main]/Main/Node[Node-002]/File[/root/helloworld.txt]: Could not evaluate: Could not retrieve information from environment production source(s) puppet:///modules/templates/Node-002.example.com/hosts.erb
The template location is as follows:
ls -l /apps/wps/puppetlabs/code/environments/production/modules/templates/Node-002.example.com/hosts.erb
-rw-r--r-- 1 puppet puppet 462 Jul 20 02:13 /apps/wps/puppetlabs/code/environments/production/modules/templates/Node-002.wiley.com/hosts.erb
Even if I give the full path in the source
parameter , it is failing with the same error.
I am using Puppet 4.5.4
Please suggest