Satellite 5.7 with cloned channels: Scripts for errata transport and patch report
Hello
We are using cloned channels on our 5.7 satellite server.
Clones are organized like this:
org_channel_parent -> somename_dev_orgname -> somename_qa_orgname -> somename_prod_orgname
org_channel_childs somename_dev_orgchildnames somename_qa_orgchildnames somename_prod_orgchildnames
Drawback of this setup is that you don't see which errata are missing on a server unles you have transported it to the cloned channels.
Therefore I made a script to create a patch report for a given server. The script is far from perfect and actually quite slow and complicated (that is badly written). Anyways it works for me and you might find it usefull.
This script should also work for servers using original channels.
The other problem arises when you want to quickly push some errata to the cloned channels. Thats what clone.errata.py is for.
You probably have to change the server and account name in the scripts.
Here's the usage of clone.errata.py
Usage: clone-errata.py [options]
Clone errata(s) or CVE(s) to channel(s)
Options:
-h, --help show this help message and exit
-e {errata|cve}[,{errata|cve}[,...]]
Comma separated list of errata or CVE to clone.
-c channel[,channel[,...]]
Comma separated list of channels to clone to. Errata
is only cloned if it is already applied to the channel
clone source! If not set, clone to all channels.
-q re Regular expression for channel selection. Do not use
with options -c, -t and -r.
-t Get channel parent for given channels and apply errata
to whole tree. You probably want to use this always
-r Recursive apply to all clone destinations
-u user Satellite user account
-s server Satellite server name
-y Clone without confirmation
Example 1: Clone errata RHSA-2015:1981 to the parent of <clone_channel>
and all childs:
clone-errata.py -e RHSA-2015:1981 -c <clone_channel> -t
Example 2: Clone errata RHSA-2015:2068 to all applicable channels:
clone-errata.py -e RHSA-2015:2068 -r -t
Example 3: Clone errata RHSA-2015:2068 to all channels with "_dev_"
in their name:
clone-errata.py -e RHSA-2015:2068 -q _dev_
Example 4: Clone errata for CVE-2015-7181 to all channels with '-server.*-7$'
in their name:
clone-errata.py -e CVE-2015-7181 -q '-server.*-7$'
Here is an example report:
$ /path/to/patch-report.py server-name
Satellite password for user_name:
Server: server-name
ServerId: 1000023456
Cloned Base Channel: someorg_66z_app_qa_rhel-x86_64-server-6.6.z
Cloned Child Channel: someorg_66z_app_qa_rhel-x86_64-server-6.6.z-vmware-tools-esxi-51ep03
Cloned Child Channel: someorg_66z_app_qa_pk-3rd-rhel-x86_64-server-6.6.z
Cloned Child Channel: someorg_66z_app_qa_pk-rhel-x86_64-server-6.6.z
Cloned Child Channel: someorg_66z_app_qa_rhel-x86_64-server-optional-6.6.z
Cloned Child Channel: someorg_66z_app_qa_rhel-x86_64-server-supplementary-6.6.z
Cloned Child Channel: someorg_66z_app_qa_rhn-tools-rhel-x86_64-server-6.6.z
Original Base Channel: rhel-x86_64-server-6.6.z
Original Child Channel: someorg_66z_app_dev_rhel-x86_64-server-6.6.z-vmware-tools-esxi-51ep03
Original Child Channel: pk-3rd-rhel-x86_64-server-6
Original Child Channel: pk-rhel-x86_64-server-6
Original Child Channel: rhel-x86_64-server-optional-6.6.z
Original Child Channel: rhel-x86_64-server-supplementary-6.6.z
Original Child Channel: rhn-tools-rhel-x86_64-server-6.6.z
1: RHBA-2015:1997 Bug Fix Advisory logrotate bug fix update
1: logrotate-3.7.8-17.el6_6.1.x86_64
2: RHBA-2015:1885 Bug Fix Advisory irqbalance bug fix update
2: irqbalance-1.0.4-11.el6_6.x86_64
3: RHBA-2015:1653 Bug Fix Advisory bash bug fix update
3: bash-4.1.2-29.el6_6.1.x86_64
4: RHEA-2015:1863 Product Enhancement Advisory tzdata enhancement update
4: tzdata-2015g-2.el6.noarch
Superseding version: 2015f-1.el6.noarch
From: RHEA-2015:1625 Product Enhancement Advisory tzdata enhancement update
5: RHBA-2015:2067 Bug Fix Advisory kernel bug fix update
5: kernel-headers-2.6.32-504.38.1.el6.x86_64
Superseding version: 2.6.32-504.36.1.el6.x86_64
From: RHBA-2015:1884 Bug Fix Advisory kernel bug fix update
Superseding version: 2.6.32-504.33.2.el6.x86_64
From: RHBA-2015:1689 Bug Fix Advisory kernel bug fix update
6: kernel-2.6.32-504.38.1.el6.x86_64
Superseding version: 2.6.32-504.36.1.el6.x86_64
From: RHBA-2015:1884 Bug Fix Advisory kernel bug fix update
Superseding version: 2.6.32-504.33.2.el6.x86_64
From: RHBA-2015:1689 Bug Fix Advisory kernel bug fix update
7: kernel-firmware-2.6.32-504.38.1.el6.noarch
Superseding version: 2.6.32-504.36.1.el6.noarch
From: RHBA-2015:1884 Bug Fix Advisory kernel bug fix update
Superseding version: 2.6.32-504.33.2.el6.noarch
From: RHBA-2015:1689 Bug Fix Advisory kernel bug fix update
8: kernel-devel-2.6.32-504.38.1.el6.x86_64
Superseding version: 2.6.32-504.36.1.el6.x86_64
From: RHBA-2015:1884 Bug Fix Advisory kernel bug fix update
Superseding version: 2.6.32-504.33.2.el6.x86_64
From: RHBA-2015:1689 Bug Fix Advisory kernel bug fix update
6: RHBA-2015:1813 Bug Fix Advisory lvm2 bug fix update
9: device-mapper-libs-1.02.90-2.el6_6.6.x86_64
Superseding version: 1.02.90-2.el6_6.5.x86_64
From: RHBA-2015:1655 Bug Fix Advisory lvm2 bug fix update
10: device-mapper-event-1.02.90-2.el6_6.6.x86_64
Superseding version: 1.02.90-2.el6_6.5.x86_64
From: RHBA-2015:1655 Bug Fix Advisory lvm2 bug fix update
11: lvm2-libs-2.02.111-2.el6_6.6.x86_64
Superseding version: 2.02.111-2.el6_6.5.x86_64
From: RHBA-2015:1655 Bug Fix Advisory lvm2 bug fix update
12: device-mapper-1.02.90-2.el6_6.6.x86_64
Superseding version: 1.02.90-2.el6_6.5.x86_64
From: RHBA-2015:1655 Bug Fix Advisory lvm2 bug fix update
13: lvm2-2.02.111-2.el6_6.6.x86_64
Superseding version: 2.02.111-2.el6_6.5.x86_64
From: RHBA-2015:1655 Bug Fix Advisory lvm2 bug fix update
14: device-mapper-event-libs-1.02.90-2.el6_6.6.x86_64
Superseding version: 1.02.90-2.el6_6.5.x86_64
From: RHBA-2015:1655 Bug Fix Advisory lvm2 bug fix update
7: RHSA-2015:2068 Security Advisory Critical: nss, nss-util, and nspr security update
15: nss-tools-3.19.1-4.el6_6.x86_64
16: nss-3.19.1-4.el6_6.x86_64
17: nss-util-3.19.1-2.el6_6.x86_64
18: nss-sysinit-3.19.1-4.el6_6.x86_64
19: nspr-4.10.8-2.el6_6.x86_64
Summary for Server server-name:
7 Errata
1 Security Advisory
1 Critical
0 Important
0 Moderate
0 Low
5 Bug Fix Advisory
1 Product Enhancement Advisory
0 EPEL Advisory
4 Superseded Errata
0 Superseded Security Advisory
0 Critical
0 Important
0 Moderate
0 Low
3 Superseded Bug Fix Advisory
1 Superseded Product Enhancement Advisory
19 Packages
0 Unknown Packages (3rd party)
Hope you find this usefull
Regards
Kolja