Re: Re: Modify a YAML file

Jerome Verleyen <[email protected]> Fri, 15 Aug 2025 17:02:06 -0600
Newsgroups gmane.comp.sysutils.cfengine.general
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--------------a4zhOxu1of0FuyALPENGG010
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: quoted-printable

Dear Nick et all ...

Le 13/08/2025 =C3=A0 08:42, Nick Anderson a =C3=A9crit=C2=A0:
>
> Here is another variant that uses a data structure (here it's a=20
> classic associative array, but it could be a data container (defined=20
> from JSON or YAML etc =E2=80=A6)
>
> bundle agent test
> {
>    # Replace IP address of file   vars:
>        "start_ends[ipaddr]" string =3D>"172.16.1.1";
>        "start_ends[network]" string =3D>"172.16.1.0";
>        "l_start_ends" slist =3D> getindices( start_ends);
>
>  =20

I forgot totaly the magic of the list in Cfengine, with automatic loops=20
! That's make all the stuff in my case. Thank's a lot.

Thank's too to Lars and Craig with their solutions. I will use in others=20
stuff, although.

I've learn a lot with our solutions of all, and late to answer that i=20
implement solutions in the moment!

Regards!

--=20
-- J=C3=A9r=C3=B4me
J'aime le travail : il me fascine.
Je peux rester des heures =C3=A0 le regarder
	(J=C3=A9r=C3=B4me K. J=C3=A9r=C3=B4me)

--=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/7b7803f6-91fc-4027-86f7-cd36d43590b2%40ibt.unam.mx.

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

<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DUTF-8=
">
  </head>
  <body>
    <div class=3D"moz-cite-prefix">Dear Nick et all ...</div>
    <div class=3D"moz-cite-prefix"><br>
    </div>
    <div class=3D"moz-cite-prefix">Le 13/08/2025 =C3=A0 08:42, Nick Anderso=
n a
      =C3=A9crit=C2=A0:<br>
    </div>
    <blockquote type=3D"cite" cite=3D"mid:[email protected]">
      <meta http-equiv=3D"content-type" content=3D"text/html; charset=3DUTF=
-8">
      <p>
        Here is another variant that uses a data structure (here it's a
        classic associative array, but it could be a data container
        (defined from JSON or YAML etc =E2=80=A6)
      </p>
      <div class=3D"org-src-container">
        <pre class=3D"src src-cfengine3">
<span style=3D"color: #a89984; font-weight: bold;">bundle</span> <span
        style=3D"color: #458588; font-weight: bold;">agent</span> <span
        style=3D"color: #458588;">test</span>
<span style=3D"color: #689d6a;">{</span>
  <span style=3D"color: #7c6f64;"># Replace IP address of file
</span>  <span style=3D"color: #a89984; font-weight: bold;">vars</span>:
      <span style=3D"color: #689d6a;">"start_ends[ipaddr]"</span> <span
        style=3D"color: #d79921;">string</span> =3D&gt; <span
        style=3D"color: #689d6a;">"172.16.1.1"</span>;
      <span style=3D"color: #689d6a;">"start_ends[network]"</span> <span
        style=3D"color: #d79921;">string</span> =3D&gt; <span
        style=3D"color: #689d6a;">"172.16.1.0"</span>;
      <span style=3D"color: #689d6a;">"l_start_ends"</span> <span
        style=3D"color: #d79921;">slist</span> =3D&gt; getindices<span
        style=3D"color: #d79921;">(</span> start_ends <span
        style=3D"color: #d79921;">)</span>;

 </pre>
      </div>
    </blockquote>
    <p>I forgot totaly the magic of the list in Cfengine, with automatic
      loops ! That's make all the stuff in my case. Thank's a lot.</p>
    <p>Thank's too to Lars and Craig with their solutions. I will use in
      others stuff, although. <br>
    </p>
    <p>I've learn a lot with our solutions of all, and late to answer
      that i implement solutions in the moment!</p>
    <p>Regards!<br>
    </p>
    <pre class=3D"moz-signature" cols=3D"72">--=20
-- J=C3=A9r=C3=B4me=20
J'aime le travail : il me fascine.=20
Je peux rester des heures =C3=A0 le regarder
	(J=C3=A9r=C3=B4me K. J=C3=A9r=C3=B4me)
</pre>
  </body>
</html>

<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/7b7803f6-91fc-4027-86f7-cd36d43590b2%40ibt.unam.mx?utm_medium=
=3Demail&utm_source=3Dfooter">https://groups.google.com/d/msgid/help-cfengi=
ne/7b7803f6-91fc-4027-86f7-cd36d43590b2%40ibt.unam.mx</a>.<br />

--------------a4zhOxu1of0FuyALPENGG010--