Add provisioning to the example
This commit is contained in:
parent
2daabdf9fb
commit
65d986c436
3 changed files with 31 additions and 0 deletions
22
example/Vagrantfile
vendored
22
example/Vagrantfile
vendored
|
@ -13,4 +13,26 @@ Vagrant.configure("2") do |config|
|
|||
lxc.start_opts << 'lxc.cgroup.memory.limit_in_bytes=400M'
|
||||
lxc.start_opts << 'lxc.cgroup.memory.memsw.limit_in_bytes=500M'
|
||||
end
|
||||
|
||||
config.vm.provision :shell, :inline => <<-SCRIPT
|
||||
echo "Hi there I'm the shell script used for provisioning"
|
||||
if `which puppet > /dev/null`; then
|
||||
echo "Looks like puppet has already been installed, moving on"
|
||||
exit 0
|
||||
fi
|
||||
echo "I'm about to install puppet!"
|
||||
sleep 1
|
||||
echo "Hang tight, I just need to wait for a while since vagrant-lxc is not handling network properly ;)"
|
||||
sleep 5
|
||||
sudo apt-get update
|
||||
sudo apt-get install puppet -y
|
||||
SCRIPT
|
||||
|
||||
config.vm.provision :puppet do |puppet|
|
||||
puppet.module_path = "puppet/modules"
|
||||
puppet.manifests_path = "puppet/manifests"
|
||||
puppet.manifest_file = "site.pp"
|
||||
# If you want to make some noise
|
||||
# puppet.options << [ '--verbose', '--debug' ]
|
||||
end
|
||||
end
|
||||
|
|
6
example/puppet/manifests/site.pp
Normal file
6
example/puppet/manifests/site.pp
Normal file
|
@ -0,0 +1,6 @@
|
|||
Exec { path => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/'] }
|
||||
|
||||
notice "Hi there! puppet here"
|
||||
|
||||
require hello_world
|
||||
|
3
example/puppet/modules/hello_world/manifests/init.pp
Normal file
3
example/puppet/modules/hello_world/manifests/init.pp
Normal file
|
@ -0,0 +1,3 @@
|
|||
class hello_world {
|
||||
notice "Hi there! It's a puppet module here. Things seem to be working just fine ;-)"
|
||||
}
|
Loading…
Reference in a new issue