Enhancement request. Install puppet agent. At some point, it used to install puppet agent, but doesn't seem to do this anymore, as per current docs.
Vagrant 2.1.2
ProductName: Mac OS X
ProductVersion: 10.13.5
BuildVersion: 17F77
Distributor ID: Ubuntu
Description: Ubuntu 16.04.4 LTS
Release: 16.04
Codename: xenial
Vagrant.configure('2') do |config|
config.vm.box = 'bento/ubuntu-16.04'
config.vm.network 'forwarded_port', guest: 80, host: 8081
config.vm.provision 'puppet'
end
https://gist.github.com/darkn3rd/9eb6f98b77680b8ed49bd2ce2c8602c5
Puppet would be installed and work.
Puppet is not installed
vagrant up```bash
mkdir manifests
cat <<<-MANIFEST > manifests/default.pp
class hello_puppet {
package { 'apache2':
ensure => present,
}
service { 'apache2':
ensure => running,
enable => true,
}
}
MANIFEST
Does your machine have anything inside of /opt/puppetlabs/bin/puppet? Is puppet installed on your guest? According to the docs, Vagrant will not install Puppet and expects it to be installed on your guest for the Puppet Apply provisioner to work: https://www.vagrantup.com/docs/provisioning/puppet_apply.html#bare-minimum
Thanks!
That is why this is an enhancement request. This is an enhancement request to add the capability for installations.
All other provisioners have this capability, so puppet is the only one that does not have the ability to bootstrap the agent on the system.
#!/bin/sh
command -v puppet > /dev/null && { echo "Puppet is installed! skipping" ; exit 0; }
ID=$(cat /etc/os-release | awk -F= '/^ID=/{print $2}' | tr -d '"')
VERS=$(cat /etc/os-release | awk -F= '/^VERSION_ID=/{print $2}' | tr -d '"')
case "${ID}" in
centos|rhel)
wget https://yum.puppet.com/puppet5/puppet5-release-el-${VERS}.noarch.rpm
rpm -Uvh puppet5-release-el-${VERS}.noarch.rpm
yum install -y puppet-agent
;;
fedora)
rpm -Uvh https://yum.puppet.com/puppet5/puppet5-release-fedora-${VERS}.noarch.rpm
yum install -y puppet-agent
;;
debian|ubuntu)
wget https://apt.puppetlabs.com/puppet5-release-$(lsb_release -cs).deb
dpkg -i puppet5-release-$(lsb_release -cs).deb
apt-get -qq update
apt-get install -y puppet-agent
;;
*)
echo "Distro '${ID}' not supported" 2>&1
exit 1
;;
esac
https://github.com/petems/vagrant-puppet-install might help with this 馃憤
Thanks for the script! However I am expecting the actual implementation to be a lot more complex than this. We'll need windows support (and other guests that puppet agents can run on), the ability to configure which version of puppet you are installing (to support older modules), and unit tests. Probably more that I am forgetting? An example of this pattern would be the docker provisioner, which has a similar architecture within vagrant as a provisioner. I'm writing this all up now as a starting point for future reference for anyone who decides to pick up this task.
Most helpful comment
That is why this is an enhancement request. This is an enhancement request to add the capability for installations.
All other provisioners have this capability, so puppet is the only one that does not have the ability to bootstrap the agent on the system.