[Spacewalk-list] Automatic auto updates
William H. ten Bensel
WHTENBEN at up.com
Thu Mar 10 15:50:17 UTC 2016
Python would be the best way, but if you are interested in bash/spacecmd
examples. Just some quick examples.
for server in `spacecmd -s xxxxxx -u yyyyy -p zzzzzz -q group_listsystems
group`; do
for errata in `spacecmd -s xxxxxx -u yyyyy -p zzzzzz -q
system_listerrata $server |egrep -vi "^security|^-|^bug|^enhancement"
|grep [a-zA-Z0-9] |awk '{print $1}'`; do
spacecmd -s xxxxxx -u yyyyy -p zzzzzz -q
system_applyerrata $server $errata
done
done
To save several spacecmd, %sessions, and schedules on the above, could
also do.
server_errata=`spacecmd -s xxxxxx -u yyyyy -p zzzzzz -q
system_listerrata $server |egrep -vi "^security|^-|^bug|^enhancement"
|grep [a-zA-Z0-9] |awk '{print $1}' |paste -s -d" "`
spacecmd -s xxxxxx -u yyyyy -p zzzzzz -q system_applyerrata
$server $server_errata
yum update -y, with error checking and any additional scripting needed.
server_list=`spacecmd -s xxxxxx -u yyyyy -p zzzzzz -q
group_listsystems group |paste -s -d" "`
spacecmd -s xxxxxx -u yyyyy -p zzzzzz -q -- system_runscript
$server_list -u root -g root -t7200 -f /pathtofile.sh (yum with error
checking and returns)
reboot (if servers are not running osad, then the -s schedule needs to be
> 4 hours then when the reboot command is sent)
Caution: ensure that virtuals are removed, that exist on hypers
that are going to be rebooted.
server_list=`spacecmd -s xxxxxx -u yyyyy -p zzzzzz -q
group_listsystems group |paste -s -d" "`
spacecmd -s xxxxxx -u yyyyy -p zzzzzz -q -- system_runscript
$server_list -u root -g root -t7200 -s YYYYMMDD[HHMM]-f /reboot2am.sh
reboot.sh --->
#/bin/bash
nohup shutdown -r HH:MM > /dev/null 2>&1 &
exit 0
shutdown -c can be ran on the servers before HH:MM just in case a mistake
was made!
- Thanks and good luck
From: Alexander Dacre <alex.dacre at aridhia.com>
To: Евгений <evgen787 at mail.ru>, "spacewalk-list at redhat.com"
<spacewalk-list at redhat.com>
Date: 03/10/2016 05:01 AM
Subject: Re: [Spacewalk-list] Automatic auto updates
Sent by: spacewalk-list-bounces at redhat.com
This email originated from outside of the company. Please use discretion
if opening attachments or clicking on links.
I can?t share the code we?ve written ? company won?t let me ? but the
applications utilise the XML RPC API:
http://www.spacewalkproject.org/documentation/api/2.4/.
A quick pseudocode example would be to:
CALL systemgroup.listSystems(?group name?)
FOR EACH SYSTEM:
CALL system.getUnscheduledErrata
FOR EACH ERRATUM:
System.scheduleApplyErrata
Pretty straightforward to do in Python.
Thanks,
Alex Dacre
Systems Engineer
+44 131 560 1476
+44 7713281778
From: spacewalk-list-bounces at redhat.com [
mailto:spacewalk-list-bounces at redhat.com] On Behalf Of ???????
Sent: 10 March 2016 09:21
To: spacewalk-list at redhat.com
Subject: Re: [Spacewalk-list] Automatic auto updates
Hmm, via spacecmd?
Can chops and share examples? :)
Thanks.
Evgeniy
Четверг, 10 марта 2016, 7:48 UTC от Alexander Dacre <
alex.dacre at aridhia.com>:
Absolutely!
We do this with the API. I provide a system group to a little bespoke
application which goes off and gets all the member systems. For each
system it calls the getUnschedulerErrata method and then another to
schedule them at a specified time. There is some other stuff it does like
customer notifications etc too.
The reboot can also be done via the API with a similar method.
Sent from my iPhone
> On 10 Mar 2016, at 06:42, Евгений <evgen787 at mail.ru> wrote:
>
> Hi all,
>
> Can I do with spacewalk automatic patch management?
>
> Example:
>
> GroupA - regular check and install all updates(or errata), reboot as
needed.
> All this in maintenance window - 2:3AM
>
> GroupB - regular check and install all updates(or errata), reboot as
needed.
> All this in maintenance window - 4:5AM
>
> In Windows, all this susses fully doing in wsus+sccm.
>
> Evgeniy
>
> _______________________________________________
> Spacewalk-list mailing list
> Spacewalk-list at redhat.com
> https://www.redhat.com/mailman/listinfo/spacewalk-list
_______________________________________________
Spacewalk-list mailing list
Spacewalk-list at redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-list
This email originated from outside of the company. Please use discretion
if opening attachments or clicking on links.
_______________________________________________
Spacewalk-list mailing list
Spacewalk-list at redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-list
**
This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies.
**
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/spacewalk-list/attachments/20160310/f4f87f02/attachment.htm>
More information about the Spacewalk-list
mailing list