Ask Your Question

Is it possible to source a file from a file outside a module?

asked 2015-06-02 16:04:12 -0500

On my nodes I want to source this /tmp/foo file with the contents of the node ~/bar file not using the master module copy stored on the files folder. Is that possible?

edit retag flag offensive close merge delete


Sorry, i don't get it. Do you want to source (IOW reading line after line) the contents of the local file /tmp/foo on bar and than doing something with it in puppet. Or do you want a local file to act as source parameter in the file resource?

far4d gravatar imagefar4d ( 2015-06-03 03:02:35 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2015-06-03 03:55:16 -0500

shirish shukla gravatar image

You can do something like below

$ mkdir /etc/puppet/Shared_Files/scripts/     <- Put your file here

Add below in File: vi /etc/puppet/fileserver.conf

    path /etc/puppet/Shared_Files
    allow *

And use this shared file server location as below.

file {"/tmp/":
          ensure => present,
          mode => 664,
          owner => root,
          group => root,
          source => "puppet:///shared_files/scripts/"
edit flag offensive delete link more


Actually it was also possible refering to a specific path on the node's filesystem: file { "/tmp/foo": ensure => 'present', source => '/etc/bar', }

Emerson Posadas gravatar imageEmerson Posadas ( 2015-06-03 09:36:15 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-06-02 16:04:12 -0500

Seen: 1,327 times

Last updated: Jun 03 '15