Skip to content

Instantly share code, notes, and snippets.

@garthk
Created April 12, 2012 23:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garthk/2371859 to your computer and use it in GitHub Desktop.
Save garthk/2371859 to your computer and use it in GitHub Desktop.
File source fallback style for Puppet modules
class elasticsearch {
# ...
file { "/etc/elasticsearch/elasticsearch.yml":
ensure => present,
source => ["puppet:///files/site-elasticsearch/${fqdn}/elasticsearch.yml",
"puppet:///files/site-elasticsearch/elasticsearch.yml",
"puppet:///modules/elasticsearch/elasticsearch.yml"],
owner => root,
group => root,
}
}
@garthk
Copy link
Author

garthk commented Apr 12, 2012

What's the community's preferred style for modules giving default content for a file, but allowing users to supply their own content on a site or node basis?

I first tripped over the idea in lelutin/puppet-apt_cacher_ng@1ba3928. I'm now using puppet:///files/ to avoid Error 400 on SERVER: Not authorised to call find.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment