2

We are using puppet version 2.7.11 on a debian client with autostart enabled (START=yes in /etc/default/puppet). We connect to the puppetmaster using a certificate with the FQDN (dummyclient.work-network.pri) and it works fine. The altered /etc/default/puppet file is shipped to our client, for example.

The problem is: After a restart we see a new certificate request by dummyclient which our puppetmaster considers as a completely different machine. One reason for this seems to be that we are using DHCP for our client names and ip addresses and the network may not yet be fully there when puppet-agent is started. (In our syslog puppet-agent is started before NetworkManager gives information about the nameserver and domain name.) As a further proof hostname -f is also empty during boot (whereas hostname -s gives the correct answer).

Apparently, the running puppet process does not ever update this information no matter how long the system runs. (Manually started puppet runs use the FQDN.)

Is it possible to delay the time puppet is being started or alternatively trigger a puppet restart whenever the network information changes. (E.g. when the client has been started without a network connection at all.)

Or would the optimal solution simply be to hardcode the FQDN in the client’s /etc/hosts file? (But then again, this should be the job of our DHCP server, no?)

Debilski
  • 125
  • 5

1 Answers1

2

It's entirely possible to change the order in which services are started on boot. See www.debian.org for information about how runlevel works and how to change the order in which startup scripts are run.

If you want to have puppet restart whenever you get a new dhcp lease, you could put in a cron job that periodically checks for new dhcp leases in /var/lib/dhcp.leases and does a restart when there's a change.

Jenny D
  • 27,358
  • 21
  • 74
  • 110
  • I’d rather find this update functionality inside puppet itself than to change order or running scripts, though. I’m guessing there must be a reason the debian package provides `rc2.d/S21puppet`. – Debilski Feb 21 '13 at 13:10