Created
August 25, 2011 08:43
-
-
Save kwilczynski/1170253 to your computer and use it in GitHub Desktop.
Usage of resolve_source
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How to fall-back to template when the source file is not present on the Puppet Master? | |
$file = '/tmp/file.txt' | |
$source = resolve_source("puppet://test/file.txt.${fqdn}", | |
"puppet://test/file.txt.${domain}", | |
'puppet://test/file.txt') | |
if empty($source) { | |
file { $file: | |
content => template('test/file.txt.erb') | |
} | |
} else { | |
file { $file: | |
source => $source | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment