Skip to content

Instantly share code, notes, and snippets.

@cmattoon
Created September 18, 2015 20:16
Show Gist options
  • Save cmattoon/323d977c6c9cb7805366 to your computer and use it in GitHub Desktop.
Save cmattoon/323d977c6c9cb7805366 to your computer and use it in GitHub Desktop.
Puppet file vs. URL
# Assume a file located at /etc/puppet/environments/development/modules/foo/files/bar/baz.txt
$file_contents = file('foo/bar/baz.txt', '/dev/null')
if $file_contents != '' {
file { '/tmp/baz.txt':
content => $file_contents
}
}
## OR...
$file_url = 'puppet:///modules/foo/bar/baz.txt'
file { '/tmp/baz.txt':
source => $file_url
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment