2

I'm trying to integrate puppet and vSphere via this module:

https://forge.puppetlabs.com/puppetlabs/vsphere

This module lets you create servers via a few lines of puppet code.

I have a vm template that I'm cloning from. It has vmware tools and puppet client installed on it.

The node comes up, but then the puppet master thinks all successive clones are the same node, probably because they have the same SSL cert.

So how is this supposed to work? I can fix the SSL issue on a single node, but I want to be able to create 100 nodes in an automated fashion.

It looks like puppet resource vsphere_vm is supposed to show the guest ip, which I would imagine could then be fed into puppet and have the node provisioned from there, but that command is not producing any ip information currently.

There must be someone using this puppet vsphere plugin who is using it to spin up nodes in an automated fashion. This also implies a more general question: how do you automate creation and provisioning of a server with puppet if you are using an image based virtualization technology like vSphere?

As an item of note, I'm using puppet enterprise 2015.2.

0

You have to detect what information is used by puppet server to detect same node and prepare script for changing it. Script will be prepared to run just after boot of new node and re-uniq those information, puppet server will think this is new server and will manage it.

0

I have a vm template that I'm cloning from. It has vmware tools and puppet client installed on it.

The node comes up, but then the puppet master thinks all successive clones are the same node, probably because they have the same SSL cert.

To resolve this you want to have a template that has the puppet client but has not yet generated the CSR with the puppet server. You can convert the template back to a VM and delete (or rename) the client's puppet ssl directory (not sure where it's stored on PE 2015.2 but on Puppet v4 it's under /etc/puppetlabs/puppet/ssl).

Then on the puppet server do a puppet cert clean <name> where <name> is the cert that was generated by the template.

Convert the VM back to a template. Now any VMs deployed from this template will generate their own CSRs after running puppet agent -t. The downside is that you will have to sign each new cert whenever the CSR is generated. To make it more automation friendly you can configure you puppet server to autosign certs using autosign = true in the server's puppet.conf file. However this is not recommended to keep in production environments. This doc goes into more detail about autosigning certs: https://docs.puppetlabs.com/puppet/latest/reference/ssl_autosign.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.