I have a host where puppet is running as daemon, refreshing every 30 minutes as per default, and a custom class is applied.
The class contains:
- A "file" resource to ensure a directory is created.
- A "package" resource to ensure the nfs-utils RPM is installed.
- A "mount" resource to mount a NFS share into the directory created in 1 and add the related line to /etc/fstab. This resource requires resources 1 and 2.
- A "yumrepo" resource which creates and enables a local yum repository whose files are located in the mounted share. This requires resource 3.
The host has a preexisting problem in its fstab file: there is one custom line which starts with leading spaces, which appears to be a somewhat invalid syntax (cannot find official docs about this, though).
Due to this problem in fstab, any manual puppet run e.g. "puppet agent --test" fails when applying the mount resource and flushing the fstab file, which is ok ("Could not evaluate: Field 'device' is required").
The real problem happens with periodic automated runs: a first run correctly stops at the mount resource, but the second run terminates with no errors even though it cannot successfully mount the share, and what's worse, it even applies the yumrepo resource, thus ignoring the "require" parameter.
A third run stops again on mount, while a fourth behaves like the second one, and so on. Puppet alternates endlessly between the two behaviours.
This is of course very confusing, and also leaves the machine in a broken state, with a configured repository which actually doesn't work.
I attach the log obtained with "--debug --verbose --logdest /var/log/puppet/debug.log". It contains output from two subsequent runs: the first stops at the mount error, while the second one skips it and applies the yumrepo.