Clients Update Using Recurring Actions
This workflow shows how to automate updating the clients registered at SUSE Manager using recurring actions.
The workflow is applicable for Salt clients only.
1. Use Case / Situation
Automated update of clients is benefitial when:
-
update of a large number of clients is wanted
-
the workflow should not be re-done every execution
-
a dedicated maintenance window exists.
2. Outcome / Resolution
Successful completion of this workflow results in consistent and supportable state.
3. Preparation
Before you start, you should have a number of Salt clients onboarded. It may make sense to have them sorted into groups you want to update together. In this workflow we use a system group named infra-services.
4. Step-by-Step Workflow Instructions
To update a client two steps are required. A third step is optional but highly recommended to finalize the update process.
-
As an example, we create the action to update Salt itself as a recurring action for all systems in the organization. In the SUSE Manager Web UI, navigate to and click Create.
-
Select
Action TypeCustom State and enter aSchedule Namelikeupdate-salt. -
Select a schedule. For example, Weekly: Wednesday, 9:00 am .
-
Assign the
update-saltstate by selecting the checkbox. -
Click Save Changes to save the action.
-
You can edit the execution order of the states if needed. Click Confirm to confirm the order.
-
Click Create Schedule to save the action.
-
As an example we create the action to apply all updates as a recurring action for a system group called "infra-services". In the SUSE Manager Web UI go to and click on
infra-services. -
Now go to
Recurring Actionsand click Create. -
Select
Action TypeCustom State and enter aSchedule Namelikefull-system-update. -
Select a Schedule. For example, Weekly: Wednesday, 9:30 am . Keep enough time between this action and the
update-saltaction. Theupdate-saltactions must be finished on all systems before this action should be executed. -
Assign the states
util.syncall,certs,channelsand`uptodateby selecting the checkboxes. -
Save the action by clicking Save Changes.
-
You can edit the execution order of the states. The order should be
util.syncall,certs,channels, and finallyuptodate. Click Confirm to store the order. -
Click Create Schedule to save the action.
|
The |
uptodate State is Applied-
In the SUSE Manager [web ui} go to and click Create Key.
-
Enter "mgr_reboot_if_needed" as
Key Labeland set asDescription. Define if theuptodatestate should perform a reboot if needed. Set toFalseif this is not wanted. -
Click Create Key to store the new key.
-
To assign values to multiple systems, navigate in the SUSE Manager Web UI to and select the checkbox for all systems you want to modify. These system are not in the System Set Manager (SSM).
-
Select in the left menu System Set Manager and select in the tab bar.
-
Click
mgr_reboot_if_neededand enter False asValue. -
Click Set Values to save.
-
As an example, we create the action to apply the highstate for the same group which was fully updated before. In the SUSE Manager Web UI, navigate to and click
infra-services. -
Go to
Recurring Actionsand click Create. -
Select
Action TypeHighstate and enter aSchedule Namelikehighstate. -
Select a Schedule. For example, Weekly: Wednesday, 10:30 am . Again, keep enough time between this action and the
full-system-updateaction. -
Click Create Schedule to save the action.
5. Background Information on uptodate State
-
The
uptodatestate applies critical patches to the update components.-
On SUSE-based systems, the state executes the command:
zypper --non-interactive patch --updatestack-onlyAnd then, the state also updates Salt.
-
On all the other systems, not based on SUSE, the state only updates Salt.
-
-
The state runs the package manager, such as
dnf,yum,apt, orzypperbased on what is available on the client operating system to update the rest of the packages.-
The state lists all of the upgradable packages, based on the synchronized package repositories in SUSE Manager.
-
The state upgrades the packages to their latest available version by using the client’s package manager. The executed command depends on the operating system of the client:
-
For Debian-based clients, such as Debian or Ubuntu, the action executes
apt dist-upgrade -q -y $PACKAGES. -
For RPM-based clients that are not SUSE, such as Red Hat Enterprise Linux or SUSE Liberty Linux, the action executes
yum --quiet -y update $PACKAGESordnf --quiet -y upgrade $PACKAGES(depending on the package manager the client is using). -
For non-transactional SUSE clients, such as SUSE Linux Enterprise 15, the action executes
zypper --non-interactive --auto-agree-with-licenses update $PACKAGES. -
For transactional SUSE clients, the action executes the same in a transactional shell.
-
-
-
If SUSE Manager detects that
rebootis necessary, SUSE Manager will automatically reboot that client.For more information, see the
reboot_info.pymodule: https://github.com/uyuni-project/uyuni/blob/master/susemanager-utils/susemanager-sls/src/modules/reboot_info.py
6. Related Topics
-
For more information about recurring actions, see Recurring Actions.
-
For more information about custom info values, see 自定义系统信息.