newguy
2011-Aug-02 21:15 UTC
[Puppet Users] setting the hostname automatically of EC2 puppet clients
I have 3 environments A,B,C. I am using runurl (http://agiletesting.blogspot.com/2009/09/ bootstrapping-ec2-images-as-puppet.html) to install puppet automatically as a new EC2 instance is started and connecting it automatically to the server. But the server is not aware of this new instance trying to connect so for that I want that I can configure the hostname of this new instance so that when it connects to the puppet server, based on its hostname puppet server knows which modules should be installed on this client. Please help me guys. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
edovale
2011-Aug-03 02:14 UTC
[Puppet Users] Re: setting the hostname automatically of EC2 puppet clients
If you are on ubuntu the I understand that you could set the hostname using cloud-init like explained here: https://help.ubuntu.com/community/CloudInit On Aug 2, 5:15 pm, newguy <aimanparv...@gmail.com> wrote:> I have 3 environments A,B,C. > I am using runurl (http://agiletesting.blogspot.com/2009/09/ > bootstrapping-ec2-images-as-puppet.html) to install puppet > automatically as a new EC2 instance is started and connecting it > automatically to the server. But the server is not aware of this new > instance trying to connect so for that I want that I can configure the > hostname of this new instance so that when it connects to the puppet > server, based on its hostname puppet server knows which modules should > be installed on this client. > > Please help me guys.-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Dan Carley
2011-Aug-03 09:13 UTC
Re: [Puppet Users] Re: setting the hostname automatically of EC2 puppet clients
On 3 August 2011 03:14, edovale <edovale@gmail.com> wrote:> If you are on ubuntu the I understand that you could set the hostname > using cloud-init like explained here: > https://help.ubuntu.com/community/CloudInitIt''s also possible to use cloud-init on EL based distros, as seen in the Amazon Linux AMI. I have patches for vanilla cloud-init on CentOS/RHEL that I might tidy up and release if there''s interest. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
newguy
2011-Aug-03 18:31 UTC
[Puppet Users] Re: setting the hostname automatically of EC2 puppet clients
Thanks guys but I edited the script mentioned in http://www.google.com/url?sa=D&q=http://agiletesting.blogspot.com/2009/09/ to change the hostname of the new EC2, heres what am doing: am bootstrapping EC2 images as puppet clients and am using runurl to call a script which installs puppet, This is my script with runurl cat <<EOL > /etc/hosts 127.0.0.1 abcd.local.com localhost.localdomain abcd.local.com 10.1.1.1 puppet # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts EOL hostname abdc $check=envt wget -qO/usr/bin/runurl run.alestic.com/runurl chmod 755 /usr/bin/runurl runurl puppet/init_puppet/init_puppet/ $check $check contains the value of the environment to which this client belongs. On the web server init_puppet is as follows: apt-get -y install puppet wget -qO/etc/puppet/puppet.conf http://10.1.1.1/init_puppet/puppet.conf /etc/init.d/puppet restart puppetd --test --waitforcert 65 --$2 $2 should contain the environement. This is working fine except for the fact that am unable to pass the environment value to my script on the webserver, any help on that would be appreciated. Thanks On Aug 3, 2:13 am, Dan Carley <dan.car...@gmail.com> wrote:> On 3 August 2011 03:14, edovale <edov...@gmail.com> wrote: > > > If you are on ubuntu the I understand that you could set the hostname > > using cloud-init like explained here: > >https://help.ubuntu.com/community/CloudInit > > It''s also possible to use cloud-init on EL based distros, as seen in the > Amazon Linux AMI. I have patches for vanilla cloud-init on CentOS/RHEL that > I might tidy up and release if there''s interest.-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.