Trigger full os update/upgrade

16 views
Skip to first unread message

Guillaume YONNET

unread,
Dec 20, 2021, 12:08:21 PM12/20/21
to help-cfengine
Hello,
Quite new in CfEngine configuration, and I would like to know if there was a way to :
  • Trigger full OS update/upgrade (on supported Linux distro)
  • Launch this update through WEB UI (MISSION PORTAL) ?
Thx in advance !

Nick Anderson

unread,
Feb 17, 2022, 1:57:15 PM2/17/22
to Guillaume YONNET, help-c...@googlegroups.com

Hi,

Sure. Totally doable, in many different ways.

Here is a small contrived example:

First, write your policy to trigger the full os update, guard that with a class like OS_update_upgrade_allowed;

bundle agent __main__
{
   methods:

     OS_update_upgrade_allowed::

      "Full OS Update/Upgrade"
        usebundle => full_os_update_upgrade;

}
bundle agent full_os_update_upgrade
{
  # Describe what is needed to update/upgrade

  commands:
    ubuntu::
      "/usr/bin/do-release-upgrade";

}

Then, assuming you are using 3.18.x you can use the CMDB functionality to define the default:OS_update_upgrade_allowed class on the hosts you want to upgrade. Note: by default the CMDB classes are defined in the data namespace, so specifying it with the default: prefix lets you target the default namesapce.

Reply all
Reply to author
Forward
0 new messages