Re: policy_server.dat IP to DNS

Markus Rexhepi-Lindberg <[email protected]> Tue, 11 Nov 2025 23:02:32 -0800 (PST)
Newsgroups gmane.comp.sysutils.cfengine.general
Message-ID <[email protected]>
------=_Part_213256_792026246.1762930952992
Content-Type: multipart/alternative; 
	boundary="----=_Part_213257_58207120.1762930952992"

------=_Part_213257_58207120.1762930952992
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Changing the IP address to a DNS address in the policy_server.dat for all=
=20
the clients worked nicely in my environment.

I did it using the following bundle:

bundle agent migrate_policy_server_dat
{
  files:
    "$(sys.workdir)/policy_server.dat"
      create =3D> "false",
      edit_line =3D> replace_policy_server_strings();
}

bundle edit_line replace_policy_server_strings
{
  replace_patterns:
    "192.0.2.10"
      replace_with =3D> string("cfhub01.example.com");
}

Thanks for all the help!
On Monday, October 27, 2025 at 9:29:48=E2=80=AFPM UTC+1 nick.a...@northern.=
tech=20
wrote:

>
> Marco Marongiu <[email protected]> writes:
>
> > On 20/10/2025 17:06, craig.comstock via help-cfengine wrote:
> >> 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.
> >
> > Then, I guess, an update of the documentation is in order =E2=98=BA=EF=
=B8=8F
>
> Yep.
>
> https://github.com/cfengine/documentation/pull/3533
>
>
> --=20
> Nick Anderson | Doer of Things | (+1) 785-550-1767 <(785)%20550-1767> |=
=20
> https://northern.tech
>

--=20
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 e=
mail to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/help-cfengi=
ne/9b6a0100-492e-48ea-a926-3e2c1ed0a606n%40googlegroups.com.

------=_Part_213257_58207120.1762930952992
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Changing the IP address to a DNS address in the policy_server.dat for all t=
he clients worked nicely in my environment.<br /><br />I did it using the f=
ollowing bundle:<br /><br />bundle agent migrate_policy_server_dat<br />{<b=
r />=C2=A0 files:<br />=C2=A0 =C2=A0 "$(sys.workdir)/policy_server.dat"<br =
/>=C2=A0 =C2=A0 =C2=A0 create =3D&gt; "false",<br />=C2=A0 =C2=A0 =C2=A0 ed=
it_line =3D&gt; replace_policy_server_strings();<br />}<br /><br />bundle e=
dit_line replace_policy_server_strings<br />{<br />=C2=A0 replace_patterns:=
<br />=C2=A0 =C2=A0 "192.0.2.10"<br />=C2=A0 =C2=A0 =C2=A0 replace_with =3D=
&gt; string("cfhub01.example.com");<br />}<br /><br />Thanks for all the he=
lp!<div class=3D"gmail_quote"><div dir=3D"auto" class=3D"gmail_attr">On Mon=
day, October 27, 2025 at 9:29:48=E2=80=AFPM UTC+1 [email protected] w=
rote:<br/></div><blockquote class=3D"gmail_quote" style=3D"margin: 0 0 0 0.=
8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>Marco Marongiu &lt;<a href data-email-masked rel=3D"nofollow">bront...@=
gmail.com</a>&gt; writes:
<br>
<br>&gt; On 20/10/2025 17:06, craig.comstock via help-cfengine wrote:
<br>&gt;&gt; The policy_server.dat file will include what is given to cf-ag=
ent --
<br>&gt;&gt; bootstrap. As of CFEngine 3.11 and newer it is possible to use=
 a
<br>&gt;&gt; hostname.
<br>&gt;
<br>&gt; Then, I guess, an update of the documentation is in order =E2=98=
=BA=EF=B8=8F
<br>
<br>Yep.
<br>
<br><a href=3D"https://github.com/cfengine/documentation/pull/3533" target=
=3D"_blank" rel=3D"nofollow" data-saferedirecturl=3D"https://www.google.com=
/url?hl=3Den&amp;q=3Dhttps://github.com/cfengine/documentation/pull/3533&am=
p;source=3Dgmail&amp;ust=3D1763017011269000&amp;usg=3DAOvVaw2w3mpXJ1i7lreTS=
DczgPP8">https://github.com/cfengine/documentation/pull/3533</a>
<br>
<br>
<br>--=20
<br>Nick Anderson | Doer of Things | <a href=3D"tel:(785)%20550-1767" value=
=3D"+17855501767" target=3D"_blank" rel=3D"nofollow">(+1) 785-550-1767</a> =
| <a href=3D"https://northern.tech" target=3D"_blank" rel=3D"nofollow" data=
-saferedirecturl=3D"https://www.google.com/url?hl=3Den&amp;q=3Dhttps://nort=
hern.tech&amp;source=3Dgmail&amp;ust=3D1763017011269000&amp;usg=3DAOvVaw2uC=
CfQb3YkahObgfdNOj7a">https://northern.tech</a>
<br></blockquote></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;help-cfengine&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]">help-=
[email protected]</a>.<br />
To view this discussion visit <a href=3D"https://groups.google.com/d/msgid/=
help-cfengine/9b6a0100-492e-48ea-a926-3e2c1ed0a606n%40googlegroups.com?utm_=
medium=3Demail&utm_source=3Dfooter">https://groups.google.com/d/msgid/help-=
cfengine/9b6a0100-492e-48ea-a926-3e2c1ed0a606n%40googlegroups.com</a>.<br /=
>

------=_Part_213257_58207120.1762930952992--

------=_Part_213256_792026246.1762930952992--