Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/blalor/vagrant-puppet-example
Example Puppet config that can be reused between Vagrant and "real" systems
https://github.com/blalor/vagrant-puppet-example
Last synced: 16 days ago
JSON representation
Example Puppet config that can be reused between Vagrant and "real" systems
- Host: GitHub
- URL: https://github.com/blalor/vagrant-puppet-example
- Owner: blalor
- Archived: true
- Created: 2013-01-29T14:33:42.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-01-29T14:36:58.000Z (almost 12 years ago)
- Last Synced: 2024-08-01T05:24:07.509Z (3 months ago)
- Language: Ruby
- Size: 96.7 KB
- Stars: 31
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Reusable Puppet config for Vagrant
This provides a very simple example that shows how you can reuse
[Puppet][puppet] configuration between [Vagrant][vagrant] and your non-Vagrant
systems, including data lookup via Hiera.Tested with Puppet 3.0.2.
## Vagrant
The Vagrant-specific configuration is captured in the `Vagrantfile`. The
resulting Puppet invocation is
cd /tmp/vagrant-puppet/manifests \
&& FACTER_is_vagrant='true' puppet apply \
--hiera_config hiera.yaml \
--modulepath '/tmp/vagrant-puppet/modules-0' \
/tmp/vagrant-puppet/manifests/default.ppWhen provisioned (via `vagrant up` or `vagrant provision`) you will see the
following on the console:Notice: role::ui configured for vagrant; hostname: 192.168.42.42
## Other environments
A sample `puppet_apply.sh` script is included in the `puppet` directory. All
that is required is to clone this repository (or otherwise make the files
available on the target system).## Tweaks
### `is_vagrant` fact
This could be replaced with the direct definition of a `data_center` fact.
### Vagrant shell provisioner
Vagrant takes care of providing mounts for the manifests and modules, so the
configuration would only get shuffled around a bit, but it's possible to
directly invoke `puppet_apply.sh` from Vagrant.### `hieradata` path messiness
There's no way to provide variables to Hiera for path expansion other than via
Puppet itself. It's a bit chicken-and-eggy. The provided `hiera.yaml` uses a
relative path to the `hieradata` directory that is compatible with the Vagrant
invocation of Puppet, and the example `puppet_apply.sh` similarly takes care of
the path munging, but it doesn't feel all that clean to me.# References
* [Puppet][puppet]
* [Vagrant][vagrant]
* [Puppet "pure fact-driven" nodeless configuration](http://www.semicomplete.com/blog/geekery/puppet-nodeless-configuration)
* Jordan Sissel's [nodeless](https://github.com/jordansissel/puppet-examples/tree/master/nodeless-puppet/) and [masterless](https://github.com/jordansissel/puppet-examples/tree/master/masterless) puppet examples[puppet]: http://puppetlabs.com
[vagrant]: http://vagrantup.com