Dan White
2011-Sep-07 15:19 UTC
[Puppet Users] My Solution: Clients that change name and IP address (with one small issue remaining)
Hey folks, I promised to share what I figured out and here it is:
First of all, I''m using cobbler/kickstart to build the machines, so I
edited the snippet "puppet_register_if_enabled"
to the following:
<begin /var/lib/cobbler/snippets/puppet_register_if_enabled>
#if $str($getVar(''puppet_auto_setup'','''')) ==
"1"
# generate puppet certificates and trigger a signing request, but
# don''t wait for signing to complete
MACADDR=`facter macaddress | tr "[:upper:]" "[:lower:]" |
sed ''s/://g'' `
MACADDRHOSTNAME="macaddr${MACADDR}"
COBBLERSERVER=`dig -x $server +short | sed -e ''s/.$//''`
sed -i -e "/\[main\]/a\ \ \ \
server=''${COBBLERSERVER}''" /etc/puppet/puppet.conf
sed -i -e "/server/a\ \ \ \
certname=''${MACADDRHOSTNAME}''" /etc/puppet/puppet.conf
/usr/sbin/puppetd --test --waitforcert 0
# turn puppet service on for reboot
/sbin/chkconfig --level 345 puppet on
#end if
<end /var/lib/cobbler/snippets/puppet_register_if_enabled>
This cobbler snippet will create a MAC address certname with facter and add the
server and certname lines to /etc/puppet/puppet.conf under the
"[main]" block
The small remaining issue is that the server is still using its hostname because
the client could not resolve to the server if I use a MAC-address-certname for
the server. If anyone can offer me a clue on that glitch, I would appreciate
it.
“Sometimes I think the surest sign that intelligent life exists elsewhere in the
universe is that none of it has tried to contact us.”
Bill Waterson (Calvin & Hobbes)
--
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.