Search code examples
puppet

file copy from puppet master to agent fails


I am trying to do a simple file copy from puppet master to agent.

  [root@****************** manifests]# cat site.pp

    file {'/home/ec2-user/my_bash_script.sh':
    source => "puppet:///modules/mymodule/my_bash_script.sh",
    mode => '755',
    }

please find the error.

 [root@ip-***********/]# puppet agent -t
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for ip-10-20-1-137.dev.uberops.net
Info: Applying configuration version '1472255014'
Error: /Stage[main]/Main/File[my_bash_script.sh]: Could not evaluate: 
Could not retrieve information from environment production source(s)   
puppet:///modules/mymodule/my_bash_script.sh
Notice: Finished catalog run in 0.06 seconds

Can anyone please tell me what i am missing here.


Solution

  • Could not retrieve information from environment production source(s) This error shows that , puppet is not able to find the file you pacified. Please double check for the path you are providing and for file is present there.

    General file structure is as like:

    -/etc/puppet -/etc/puppet/manifest/ -/etc/puppet/files -/etc/puppet/modules

    If you have setup your module directory somewhere else (/modules/mymodule/files/your-file-here) then your path to file would be; puppet:///modules-directory/modules-name/file-name i.e puppet:///modules/mymodule/your-file-here