Here's another option for people who are not using Puppet Cloud 
Provisioner, but for example EC2's autoscaling or launching test-instances 
by hand.:

Ubuntu and Amazon Linux images include a tool called CloudInit, which makes 
it easy to perform bootstrapping tasks on a new instance. It's built into 
the official images.

You provide scripts in the 'user-data' metadata that you enter when you 
launch an instance. CloudInit takes that input and runs it. It's quite 
versatile, supporting various formats such as shell-scripts, cloud-config 
yaml, upstart jobs, content downloaded from URLs, compressed and 
mime-multipart content, etc. 
See https://help.ubuntu.com/community/CloudInit for docs 
and 
http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/files/head:/doc/examples/
 
for some examples.

We enter something like the following in the user-data metadata to 
bootstrap our Puppet nodes. The %i is replaced with the instance-id by 
Cloud-Init, to generate a unique certname. That's all that's needed to 
bootstrap from a default Ubuntu image to a puppet node.

#cloud-config
apt_update: true
apt_upgrade: true
packages:
- puppet
puppet:
  conf:
    agent:
      server: "puppet.example.com"
      certname: "%i.web.cluster1.ec2"
      pluginsync: "true"


Regards, Martijn Heemels

Op maandag 2 juli 2012 22:58:28 UTC+2 schreef Leej het volgende:
>
> Hello, new user here. I'm trying to bootstrap an aws instance and need to 
> change the server setting in puppet.conf on the client/instance that is 
> created. Is there anyway to do this beyond modifying hosts post-hoc?
>
> puppet node_aws bootstrap --image ami-e1e8d395 --keyname mykey --login 
> ubuntu --keyfile ~mykeyfile.pem --puppetagent-certname aws_server_test 
> --region=eu-west-1 --type t1.micro -g webserver 
>
> This provisions an instance but fails to register a cert request on the 
> puppetmaster with :
>
> notice: Puppet is now installed on: 
> blahblah.eu-west-1.compute.amazonaws.com
> notice: No classification method selected
> notice: Signing certificate ...
> err: Signing certificate ... Failed
> err: Signing certificate error: Could not render to pson: getaddrinfo: 
> Name or service not known
>
> Checking the instances puppet.conf shows that the server config variable 
> is set to "puppet" which I want to change to "myserver.somewhere.com". 
> Now I dont know if this behaviour is a bug, I would have thought that since 
> I'm running puppet from the master server, bootstrapping should be able to 
> update the server variable correctly or there should at least be a command 
> line option.
>
> I know I can run a script at somepoint and modify my hosts files but I'm 
> trying to keep things automated and simple. What am I missing?
>
> I should also note, if I ssh into the created instance I can modify the 
> puppet.conf file with the correct server name and a certificate request is 
> issued which I can then sign.
>
> Any help.best practices greatly appreciated - lj.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/TL2I777bKeYJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to