Re: policy_server.dat IP to DNS

"craig.comstock via help-cfengine" <[email protected]> Mon, 20 Oct 2025 10:06:53 -0500
Newsgroups gmane.comp.sysutils.cfengine.general
Message-ID <aPZQDWadtm1G8sZN@localhost>
--ZAYupOt400A2quNK
Content-Type: text/plain; charset="UTF-8"
Content-Disposition: inline

On Mon, Oct 20, 2025 at 06:12:58AM -0700, Markus Rexhepi-Lindberg wrote:
> We have a lot of servers that was bootstrapped quite some time ago and they 
> have the IP address instead of the DNS address of the policy server in 
> their /var/cfengine/policy_server.dat file. Is there a recommended way to 
> migrate these to use the DNS address instead? I was thinking that perhaps a 
> simple bundle to update the file would suffice but I wanted to check with 
> the community first to find out if there is a better way.

Hi Markus,
The policy_server.dat file will include what is given to cf-agent --bootstrap. As of CFEngine 3.11 and newer it is possible to use a hostname.

This commit added this ability: https://github.com/cfengine/core/commit/1a45d2043615c3627069b893759e9b7d275b9938

Using a hostname has benefits and drawbacks.
The benefit is that the DNS entry could change and you could avoid having to rebootstrap to a different IP address. The caveat here is that long-running processes like cf-serverd may need a restart in order to do the name to IP translation.
Drawbacks of using a hostname are if DNS doesn't work out, which certainly is not uncommon.

I do think that using an IP address is a bit more reliable.
Instead of manipulating that file you could instead re-bootstrap with a command like cf-agent --no-lock --inform --bootstrap <newip>.

Let us know what you think and how you proceed.

-Craig

-- 
You received this message because you are subscribed to the Google Groups "help-cfengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/help-cfengine/aPZQDWadtm1G8sZN%40localhost.

--ZAYupOt400A2quNK
Content-Type: application/pgp-signature; name=signature.asc

-----BEGIN PGP SIGNATURE-----

iQFPBAEBCAA5FiEESGo8ZOGtfXSf5OBen4xVY6q84woFAmj2UAobFIAAAAAABAAO
bWFudTIsMi41KzEuMTEsMywyAAoJEJ+MVWOqvOMKSIcH/3yr+nxwOzB9j6RqyUAg
XZsSNuh145d1HZLfvMbirCFeYk/rntE70x/S7a54ckaVHYxwfk+uYDFHJINoGy3Z
frVdZTkaGh65o1ZRnxsXynnuhqkTJiGh963Q1jaqSMePle2dxD0K4L6y0Kf+hlHo
P6kT88oon/bYxcV2G4nsJDJ/KKysiJ3AZEQRuPh1UbHcg8tMVT04L26vnSRXF4KP
RcUp6rGe3NN4Lm8T7uoM6MxdKn6rgIZfamItcgT2IkAhfOCzbZBCRdhb0ER2GNmR
tLpS6+hxkJb3/MWgH38L3lefD+vCO/4E/HWzJp6OCEkF8NtCVY4KPd3TS0V5F1tk
RvA=
=YIyz
-----END PGP SIGNATURE-----

--ZAYupOt400A2quNK--