3

I'd like to setup Vagrant to use my current Puppet master as a provisioner. But I don't like the idea of embedding the SSL key pair in the .box file.

What I am currently doing is distributing the ca.pem, public, private, and cert key files for the Puppet agent with the Vagrant file and using this shell script to bootstrap the Puppet agent:

$puppet_ssl = <<SCRIPT
sudo mkdir -p /var/lib/puppet/ssl/{certs,private_keys,public_keys}
sudo chown puppet /var/lib/puppet/ssl/{certs,private_keys,public_keys}
sudo cp /vagrant/puppet/certs/appdev.mydomain.com.pem /vagrant/puppet/certs/ca.pem /var/lib/puppet/ssl/certs/
sudo cp /vagrant/puppet/private_keys/appdev.mydomain.com.pem /var/lib/puppet/ssl/private_keys/
sudo cp /vagrant/puppet/public_keys/appdev.mydomain.com.pem /var/lib/puppet/ssl/public_keys/
SCRIPT

This seems to work OK if the developer has the files and everything is in the correct directories.

My question: Is there a better way to distribute arbitrary files that need to be pre-loaded onto the Vagrant VM without embedding them into the .box file?

2
  • Hey buddy, just wandered into your post. Loving vagrant myself lately and working on something similar. Will keep an eye on this one.
    – dmourati
    May 29, 2013 at 5:16
  • Cool! Yea, I'm really liking it as a development platform. The LA team has jumped on board with Vagrant and Puppet and we are having some fun with it.
    – Andy Shinn
    May 29, 2013 at 16:43

1 Answer 1

1

The simplest way to approach this would probably be to configure your Vagrantfile to set up a synced folder on /var/lib/puppet/ssl, and load the keys out of your local Vagrant project directory. Documentation is here:

http://docs.vagrantup.com/v2/synced-folders/basic_usage.html

Alternatively, Puppet autosigning might resolve the problem well enough for your needs.

1
  • Thanks. I guess this is a sane way to do it while keeping the keys in the repo. Better than keeping the keys in the box file.
    – Andy Shinn
    May 29, 2013 at 16:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .