main vs. mpf_main: just checking...

"'Nick Anderson' via help-cfengine" <[email protected]> Thu, 23 Jan 2025 15:42:05 -0600
Newsgroups gmane.comp.sysutils.cfengine.general
Message-ID <[email protected]>
--=-=-=
Content-Type: multipart/alternative; boundary="==-=-="

--==-=-=
Content-Type: text/plain; charset="UTF-8"

  Hi David,

        We are now mostly 3.18 for binaries and for MPF. We need
        to begin the journey to 3.21.

        For local reasons, our local policy currently replaces the
        MPF "services/main.cf" file (which is where bundle "main"
        is defined) with our own small replacement.

        ...

        Having read Nick Anderson's blog post
        <https://cfengine.com/blog/2022/renaming-bundle-agent-main-in-mpf/>
        it seems that the bundle name (in our replacement
        "services/main.cf" file) must be:

        * "main" for client MPF 3.18 (and below)
        * "mpf_main" for client MPF 3.21 (and above)

        My primary question: Is my understanding of this correct?

  Yes, that's correct at least from the MPF perspective. In 3.21 and
  above the default `promises.cf' lists `mpf_main' in the
  `bundlesequence' instead of `main'. Note that 3.18 clients are
  perfectly capable of running 3.21 MPF, so I think simply renaming your
  bundle from `main' to `mpf_main' is the easiest path there.



        Secondary question (predicated on the first): to ensure
        resilient 3.18->3.21 transition, does the following look
        reasonable?
        ----------------------------------------------------------
        bundle agent main { methods: any:: "any" usebundle =>
        "mpf_main"; }

        bundle agent mpf_main

        { vars: any:: "bundlesequence" slist => {
          "policy_channels",

          "dls_promises" };

        methods:

        any:: "any" usebundle => "$(bundlesequence)";

        }
        ----------------------------------------------------------

        The intention here is that our common policy (starting at
        our "main.cf") can work reliably with potentially
        different client versions of MPF during this transitional
        phase.

  Yes, I see no issue with doing it that way. If your following the
  standard upgrade flow where your running 3.18 binaries with 3.21 MPF
  this should not be necessary there is nothing special about the binary
  version that necessitates `main' vs `mpf_main'. If however you have
  some other deployment strategy and you are overlaying this single
  policy file into a 3.18 policy set running on some 3.18 clients and
  also overlaying into a 3.21 MPF running on some other clients then I
  think your suggestion is a good solution.

-- 
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/87zfjhqkai.fsf%40northern.tech.

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

<p>
Hi David,
</p>

<blockquote style=3D"border-left: 2px solid gray; padding-left: 4px;">
<p>
We are now mostly 3.18 for binaries and for MPF.  We need to begin the jour=
ney to 3.21.
</p>

<p>
For local reasons, our local policy currently replaces the MPF "services/ma=
in.cf" file (which is where bundle "main" is defined) with our own small
replacement.
</p>

<p>
&#x2026;
</p>

<p>
Having read Nick Anderson's blog post <a href=3D"https://cfengine.com/blog/=
2022/renaming-bundle-agent-main-in-mpf/">https://cfengine.com/blog/2022/ren=
aming-bundle-agent-main-in-mpf/</a> it seems that the bundle name (in our
replacement "services/main.cf" file) must be:
</p>

<ul class=3D"org-ul">
<li>"main" for client MPF 3.18 (and below)</li>
<li>"mpf_main" for client MPF 3.21 (and above)</li>
</ul>

<p>
My primary question: Is my understanding of this correct?
</p>
</blockquote>

<p>
Yes, that's correct at least from the MPF perspective. In 3.21 and above th=
e default <code>promises.cf</code> lists <code>mpf_main</code> in the <code=
>bundlesequence</code> instead of <code>main</code>. Note that 3.18 clients=
 are perfectly capable of running 3.21 MPF, so I think simply renaming your=
 bundle from <code>main</code> to <code>mpf_main</code> is the easiest path=
 there.
</p>

<blockquote style=3D"border-left: 2px solid gray; padding-left: 4px;">
<p>

</p>

<p>
Secondary question (predicated on the first): to ensure resilient 3.18-&gt;=
3.21 transition, does the following look reasonable?
</p>
<hr />
<p>
bundle agent main
{
  methods:
    any::
      "any" usebundle =3D&gt; "mpf_main";
}
</p>

<p>
bundle agent mpf_main
</p>

<p>
{
  vars:
    any::
      "bundlesequence" slist =3D&gt; {
        "policy_channels",
</p>

<p>
  "dls_promises"
};
</p>

<p>
methods:
</p>

<p>
any::
  "any" usebundle =3D&gt; "$(bundlesequence)";
</p>

<p>
}
</p>
<hr />

<p>
The intention here is that our common policy (starting at our "main.cf") ca=
n work reliably with potentially different client versions of MPF during th=
is
transitional phase.
</p>
</blockquote>

<p>
Yes, I see no issue with doing it that way. If your following the standard =
upgrade flow where your running 3.18 binaries with 3.21 MPF this should not=
 be necessary there is nothing special about the binary version that necess=
itates <code>main</code> vs <code>mpf_main</code>. If however you have some=
 other deployment strategy and you are overlaying this single policy file i=
nto a 3.18 policy set running on some 3.18 clients and also overlaying into=
 a 3.21 MPF running on some other clients then I think your suggestion is a=
 good solution.
</p>

<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/87zfjhqkai.fsf%40northern.tech?utm_medium=3Demail&utm_source=
=3Dfooter">https://groups.google.com/d/msgid/help-cfengine/87zfjhqkai.fsf%4=
0northern.tech</a>.<br />

--==-=-=--

--=-=-=
Content-Type: text/plain; charset="UTF-8"




--
Nick Anderson | Doer of Things | (+1) 785-550-1767 | https://northern.tech

-- 
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/87zfjhqkai.fsf%40northern.tech.

--=-=-=--