Chocolately and package_module

4 views
Skip to first unread message

Bob

unread,
Dec 2, 2022, 2:37:14 PM12/2/22
to help-cfengine
I am doing some reading and it appears package_module is the new way to install packages. I am creating some new policy file and I think I am using the deprecated syntax to install some packages using Chocolately. Example:

classes:
  windows::
    "have_choco_exe" expression => fileexists("C:\ProgramData\chocolatey\bin\choco.exe");

packages:
  have_choco_exe::
    "python3"
      package_policy => "add",
      package_method => choco,
      package_select => "==",
      package_version => "3.11.0";

I cannot find how to use package_module to install using Chocolatey.  I did some reading in masterfiles/lib/packages.cf and I don't see any mention of Chocolatey there.

Can anyone share any information about using Chocolatey and package_module?

Nick Anderson

unread,
Dec 2, 2022, 2:48:53 PM12/2/22
to Bob, help-cfengine
You would need to write a chocolaty package module that communicates with the agent using the package module API.




--
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 help-cfengin...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/help-cfengine/e3f009d7-deea-4328-951e-649e4cd49807n%40googlegroups.com.

Nick Anderson

unread,
Dec 2, 2022, 3:11:32 PM12/2/22
to Bob, help-cfengine
Oh and once the module is written there's a bit of wiring to do in body common control (set default package modules for platform, and also as a.default inventory source) if you want chocolatey as default package manager that is.
Reply all
Reply to author
Forward
0 new messages