Skip to content

Instantly share code, notes, and snippets.

@j1n3l0
Last active March 9, 2018 14:43
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 j1n3l0/8345df9feaa1f541ac1fd5b3253e8f0e to your computer and use it in GitHub Desktop.
Save j1n3l0/8345df9feaa1f541ac1fd5b3253e8f0e to your computer and use it in GitHub Desktop.
Experiments provisioning vagrant VM with puppet

Directory structure

.
├── hiera
│   └── common.yaml
├── hiera.yaml
├── manifests
│   └── default.pp
├── README.md
├── install-puppet.sh
└── Vagrantfile

2 directories, 6 files
---
content: "this is a test"
file { "/tmp/foo":
content => hiera("content", "not setup right"),
ensure => present
}
---
:backends:
- yaml
:yaml:
:datadir: /vagrant/hiera/
#!/bin/sh -ex
rpm -ivh https://yum.puppetlabs.com/el/6/products/i386/puppetlabs-release-6-7.noarch.rpm
rpm -ivh http://ftp.nluug.nl/pub/os/Linux/distr/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm
yum -y install puppet
#!/bin/sh -ex
codename=`lsb_release -c | tr -d '[:space:]' | cut -d: -f2`
wget -q "https://apt.puppetlabs.com/puppet-release-${codename}.deb"
dpkg -i "puppet-release-${codename}.deb"
apt-get update
apt-get install -y puppet
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.provision "shell", path: "install-puppet.sh"
config.vm.provision "puppet" do |puppet|
puppet.hiera_config_path = "hiera.yaml"
puppet.options = ["--debug", "--verbose"]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment