I have this in my Vagrantfile
:
Vagrant.configure("2") do |config|
config.vm.provision "puppet"
end
Yet, when I run puppet --version
I get :
[vagrant@vagrant-centos65 ~]$ puppet --version
-bash: puppet: command not found
Do I need to manually install puppet?
No, (at the moment) Vagrant doesn't install it automatically.
So you either need to use a basebox which already has it installed (Puppet Labs provides boxes too), or you need to install it yourself. Probably the easiest way to install is to use shell provisioner before the puppet provisioner(s).
In response to @tmatilai, I created this simple set up:
Vagrantfile:
Vagrant.configure(2) do |config|
config.vm.box = "centos6.5_64"
config.vm.provision "shell", path: "manifests/puppet.sh"
config.vm.provision "puppet"
end
manifest/puppet.sh:
echo "Adding puppet repo"
sudo rpm -ivh https://yum.puppetlabs.com/el/6/products/x86_64/puppetlabs-release-6-7.noarch.rpm
echo "installing puppet"
sudo yum install puppet -y
echo "ensure puppet service is running"
sudo puppet resource service puppet ensure=running enable=true
#echo "ensure puppet service is running"
#sudo puppet resource service puppetmaster ensure=running enable=true
echo "ensure puppet service is running for standalone install"
sudo puppet resource cron puppet-apply ensure=present user=root minute=30 command='/usr/bin/puppet apply $(puppet apply --configprint manifest)'
[vagrant@vagrant-centos65 home]$ puppet --version
3.4.2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With