1

I'd like to use Puppet master to configure multiple development VMs with Vagrant: eg: vagrant creates a new box and provisions it using Puppet agent.

However, some testing seems to show that Puppet master assigns certificates per hostname, therefore if two clients have the same hostname, Puppet refuses to download the catalog. Is there a way on the Puppet agent/server to allow duplicate hostnames?

No confidential data is being deployed using Puppet, it is just setting up repositories and installing required software, so security isn't really a concern.

030
  • 5,901
  • 13
  • 68
  • 110
BnMcG
  • 500
  • 2
  • 5
  • 12

2 Answers2

1

In your first run (when you send the request for a new certificate) you could use the parameter --certname to give a specific name to every machine (also if they have the same hostname)

So on the shell you could use:

puppet agent -t --certname=myhostXX

On the puppet server you'll see a new request with that name.

Could this help in your environment ?

ricciocri
  • 123
  • 4
  • This sounds like it could be helpful... So even if the machines have the same hostname they will each generate a certificate with the given name (eg: hostXX)? The other possibility I considered was creating a Vagrant base box which already included the puppet certificate, could this work? – BnMcG May 14 '15 at 15:12
  • Yes if you use different certname it should work without any problem. – ricciocri May 15 '15 at 21:29
1

As ricciocri sugested you can use --certname, but in your master you can set "allow_duplicate_certs = true"

setting allow_duplicate_certs solve the problem, when you add a client with the same name of the previous one.

If you are using vagrant for dev or testing, I think you can everything together for working automaticaly

1: certname #in your client side
2: allow_duplicate_certs = true #in your master
3: autosigning #in your master

for more information about autosign https://docs.puppetlabs.com/puppet/latest/reference/config_file_autosign.html

c4f4t0r
  • 5,301
  • 3
  • 31
  • 42