Ask Your Question

Currently Learning Puppet -- need to know if I can change a hostname?

asked 2013-01-07 13:54:23 -0600

envinyater gravatar image

I just finished reading through the Puppet Tutorial, and I really like what it can do. Some parts of the tutorial went over my head but I'm going to try to find some clarity by doing it again.

Anyways, I am using cloudstack and I want to use Puppet to solve an issue we are having. When we provision a virtual machine, we need to change the hostname. I am hoping I can utilize Puppet to do this by having the Puppet Agent pre-installed on each Virtual Machine before it is spun up.

Is Puppet the way to go ... (more)

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2013-01-07 17:34:22 -0600

Stefan gravatar image

If you run the puppet agent on your new node, it will automatically create a SSL certificate if not already present.

The filename of the certificate and the node's name that is put inside the certificate is determined by the certname configuration option that defaults to the FQDN of your node. You can verify that by running puppet agent --configprint certname on your node.

If the certname is not what you want it to be (because the FQDN is not final), you can pass the certname on the commandline, e.g. your provision script or whatever could run puppet ... (more)

edit flag offensive delete link more

answered 2013-01-09 17:13:29 -0600

plathrop gravatar image

You can manage /etc/hostname as a file resource and/or use an exec resource to execute the hostname command.

edit flag offensive delete link more


How do you define the new hostname when the client needs to connect with the old one?

Raphink gravatar imageRaphink ( 2013-01-10 02:48:59 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2013-01-07 13:54:23 -0600

Seen: 4,576 times

Last updated: Jan 09 '13