Replies: 2 comments
-
Hello,
* hi, i am trying to find a way to schedule updates/reboot on the 3rd tuesday of a month in a maintenance window. Custom states can't be planned in maintenance windows, only as recurring...
There are other ways to do this, but this is the way I have used for a few years. It’s not the simplest way, but has proved robust and flexible.
I put each machine into one of several System Groups to define which patching window they have.
Then using crontab on the Uyuni machine, something like this, which runs “/root/schedule_patching.sh” on the first Monday of a month. By using Crontab, you can be extremely evolved to get things like “The 3rd Tuesday of a month” with a little googling. Eg, this is my example for the first Tuesday in a month.
# Spacewalk scheduling - Schedule Week 1 machines on week 1
30 5 1-7 * * [ "$(date --date='Tomorrow' '+\%a')" = "Tue" ] && /root/schedule_patching.sh "Patch: Week 1 Group"
schedule_patching.sh contains a number of spacecmd commands for machines in “Patch: Week 1 Group”, thus
#####################################################
# First, clear the ssm in case anything exists
spacecmd ssm_clear
# Now add all the machines from the group in $1 to ssm
spacecmd -- ssm_add group:"$1"
# Run yum update and reboot in one script to get it done sooner. any local repo updates not supplied by uyuni should be included too.
spacecmd -y -- system_runscript ssm -u root -g root -s 24h -t 1200 -f "/root/remote_update.sh"
# Housekeeping - clear the set manager.
spacecmd ssm_clear
#####################################################
The second scrpt, “/root/remote_update.sh” exists on Uyuni’s server and is copied to each machine and run there. That just runs what boils down to a “yum -y update” or “apt-get upate && apt-get -y upgrade” depending on my client’s OS, followed by a reboot.
I hope that’s useful,
Simon
From: fockarty ***@***.***>
Sent: Tuesday, July 9, 2024 12:45 PM
To: uyuni-project/uyuni ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [uyuni-project/uyuni] schedule updates on third tuesday of month (Discussion #9033)
hi, i am trying to find a way to schedule updates/reboot on the 3rd tuesday of a month in a maintenance window. Custom states can't be planned in maintenance windows, only as recurring...
It can be done via the api, scheduling updates can be done for an array of sids, for reboot only per sid..
what is the best way to do this?
—
Reply to this email directly, view it on GitHub<#9033>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A7AIN5K2ZYNHEZOHST7DJHTZLPEKVAVCNFSM6AAAAABKSWAI4SVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZWHEYTKMJQG4>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.******@***.***>>
|
Beta Was this translation helpful? Give feedback.
0 replies
-
i found the issue, maintenance time windows in uyuni are displayed as cet, the api expects utc for some reason.. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
hi, i am trying to find a way to schedule updates/reboot on the 3rd tuesday of a month in a maintenance window. Custom states can't be planned in maintenance windows, only as recurring...
It can be done via the api, scheduling updates can be done for an array of sids, for reboot only per sid..
what is the best way to do this?
Beta Was this translation helpful? Give feedback.
All reactions