I have a box on which puppet-agent does not start correctly on reboot. Well, to be more precise, the puppet-agent starts, but never contacts the server.
$ sudo journalctl -b 0 -u puppet -f
-- Logs begin at Wed 2017-02-01 18:27:11 CST. --
Mar 06 12:42:03 localhost.localdomain systemd[1]: Started Puppet agent.
Mar 06 12:42:16 localhost.localdomain puppet-agent[927]: Could not request certificate: getaddrinfo: Temporary failure in name resolution
Mar 06 12:44:16 a.real.hostname.tld puppet-agent[927]: Could not request certificate: getaddrinfo: Temporary failure in name resolution
Mar 06 12:46:16 a.real.hostname.tld puppet-agent[927]: Could not request certificate: getaddrinfo: Temporary failure in name resolution
Mar 06 12:48:16 a.real.hostname.tld puppet-agent[927]: Could not request certificate: getaddrinfo: Temporary failure in name resolution
Note how when the puppet-agent starts, the box doesn't yet know its hostname because the network stack is (apparently) not fully up. Running `systemctl restart puppet` resolves the issue until the next reboot.
I was able to find a work-around. In the systemd unit file for puppet, I changed
After=basic.target network.target
to
After=basic.target network-online.target
See:
https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/The box is a fresh install of Fedora 25 and is using the following packages:
puppet-agent-1.9.3-1.fedoraf25.x86_64
puppetlabs-release-pc1-1.1.0-5.fedoraf25.noarch
I have another box with the same setup (but a little more RAM) and the issue does not occur there.
I have two thoughts on this.
1) This is a subtle timing issue which is why I see it on one box, but not the other.
2) puppet-agent is misbehaving and ought to properly detect when the networking stack comes up.
3) If I want to resolve this, I should just use my workaround.
Does #3 seem like the best plan? I'd appreciate any insight into why the issue is occurring.
Cheers,
-Laverne Schrock