Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does vagrant automatically install puppet?

Tags:

vagrant

puppet

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?

like image 852
Eric Francis Avatar asked Feb 05 '14 21:02

Eric Francis


2 Answers

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).

like image 139
tmatilai Avatar answered Nov 11 '22 21:11

tmatilai


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
like image 7
Eric Francis Avatar answered Nov 11 '22 23:11

Eric Francis