0

I have some files I want to make accessible to all my R10K branches.

I put them in the folder which contains my environments folder at /etc/puppetlabs/code:

-/etc/puppetlabs/code
  - environments/
  - modules/
  - files/
    - file

I'm trying to access it from inside an environment like this:

$file = file('puppet:///files/file')

But I'm getting back a message that it can't be found:

Error while evaluating a Function Call, Could not find any files from puppet:///..

Update:

Also tried moving folder to a new files module and adding this to my Puppetfile:

mod "files", local: true

Then referencing the file like:

file('puppet:///modules/files/file')
Philip Kirkbride
  • 249
  • 2
  • 10
  • 30

1 Answers1

0

You need to place your files in a directory called files in your module and reference with file('puppet:///modules/files/nameoffile')

Where files is the name of your module and puppet with look for files in files/files

c4f4t0r
  • 5,149
  • 3
  • 28
  • 41