You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 4, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+40-20Lines changed: 40 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
1
# spacewalk_channel_freeze
2
2
`spacewalk_channel_freeze.py` is a tool that automatically clones software channels of systems managed by Spacewalk, Uyuni, SUSE Manager and Red Hat Satellite 5.x. It also binds affected systems to cloned channels which can be very useful when planning software staging.
3
+
I was developing this tool, because Uyuni and other derivates lack the functionality of cloning/remapping channels in an efficient way.
3
4
4
5
# Implementation
5
6
To run the script you need to specify a Spacewalk server and systems or group names that should be cloned. By default, the script will do the following:
@@ -8,10 +9,10 @@ To run the script you need to specify a Spacewalk server and systems or group na
8
9
2. Clone the appropriate channels
9
10
3. Assign the cloned channels to the affected systems
10
11
11
-
The script also allows undoing these changes after maintenance tasks.
12
+
The script also allows undoing these changes after maintenance tasks to clean-up things.
12
13
13
14
# Authentication
14
-
By default, the utility prompts for Satellite login information. For unattended maintenance, you can also specify an **authentication file** (*auth file*). This file needs to have the permissions **0400** (*only readable by owner*) and contain the username (*first line*) and password (*second line*):
15
+
By default, the utility prompts for Spacewalk login information. For unattended maintenance, you can also specify an **authentication file** (*auth file*). This file needs to have the permissions **0400** (*only readable by owner*) and contain the username (*first line*) and password (*second line*):
15
16
16
17
```
17
18
$ echo -e "USERNAME\nPASSWORD" > spacewalk.auth
@@ -50,27 +51,46 @@ $ ./spacewalk_channel_freeze.py -a spacewalk.auth [...]
50
51
|``-D`` / ``--date``| defines the date patches should be freezed (*default: current date*) |
51
52
52
53
# Examples
53
-
Freezing software channels for a particular host:
54
+
Simulate freezing software channels for a particular host (*always do this before maintenance to ensure you're not destroying things*):
INFO:satprep_patch_freeze:Cloning child-channel 'centos7-x86_64-updates' as 'centos7-x86_64-updates-satprep-webtier-2015-07-03'
59
-
INFO:satprep_patch_freeze:Cloning child-channel 'centos7-x86_64-extras' as 'centos7-x86_64-extras-satprep-webtier-2015-07-03'
60
-
INFO:satprep_patch_freeze:Cloning child-channel 'spacewalk22-client-centos7-x86_64' as 'spacewalk22-client-centos7-x86_64-satprep-webtier-2015-07-03'
61
-
INFO:satprep_patch_freeze:Cloning child-channel 'epel7-centos7-x86_64' as 'epel7-centos7-x86_64-satprep-webtier-2015-07-03'
62
-
...
58
+
Satellite Password:
59
+
INFO:spacewalk_channel_freeze:Supported API version (22) found.
60
+
INFO:spacewalk_channel_freeze:I'd like to clone base-channel 'opensuse_leap42_3-x86_64' as 'sp-2019-05-15.opensuse_leap42_3-x86_64'
61
+
INFO:spacewalk_channel_freeze:I'd like to clone child-channel 'opensuse_leap42_3-x86_64-updates' as 'sp-2019-05-15.opensuse_leap42_3-x86_64-updates'
62
+
INFO:spacewalk_channel_freeze:I'd like to clone child-channel 'opensuse_leap42_3-uyuni-client-x86_64' as 'sp-2019-05-15.opensuse_leap42_3-uyuni-client-x86_64'
63
+
INFO:spacewalk_channel_freeze:I'd like to remap client's base-channel from opensuse_leap42_3-x86_64 to sp-2019-05-15.opensuse_leap42_3-x86_64
64
+
INFO:spacewalk_channel_freeze:I'd like to set the following child-channels for client: ['sp-2019-05-15.opensuse_leap42_3-x86_64-updates', 'sp-2019-05-15.opensuse_leap42_3-uyuni-client-x86_64']
63
65
```
64
66
65
-
Simulate unfreezing software channels for a particular host. Satellite authentification is done using an auth file:
67
+
Actually clone and remap channels for a particular host:
INFO:satprep_patch_freeze:I'd like to remap tvm-web01.test.loc's base-channel from centos7-x86_64-satprep-webtier-2015-07-03 to centos7-x86_64
69
-
INFO:satprep_patch_freeze:I'd like to set the following child-channels for tvm-web01.test.loc: ['epel7-centos7-x86_64', 'centos7-x86_64-updates', 'centos7-x86_64-extras', 'spacewalk22-client-centos7-x86_64']
70
-
INFO:satprep_patch_freeze:I'd like to remove cloned child-channel 'epel7-centos7-x86_64-satprep-webtier-2015-07-03'
71
-
INFO:satprep_patch_freeze:I'd like to remove cloned child-channel 'centos7-x86_64-updates-satprep-webtier-2015-07-03'
72
-
INFO:satprep_patch_freeze:I'd like to remove cloned child-channel 'centos7-x86_64-extras-satprep-webtier-2015-07-03'
73
-
INFO:satprep_patch_freeze:I'd like to remove cloned child-channel 'spacewalk22-client-centos7-x86_64-satprep-webtier-2015-07-03'
74
-
INFO:satprep_patch_freeze:I'd like to remove cloned base-channel 'centos7-x86_64-satprep-webtier-2015-07-03'
75
-
...
69
+
# ./spacewalk_channel_freeze.py -S client
70
+
Satellite Username: admin
71
+
Satellite Password:
72
+
INFO:spacewalk_channel_freeze:Supported API version (22) found.
73
+
INFO:spacewalk_channel_freeze:Cloning base-channel 'opensuse_leap42_3-x86_64' as 'sp-2019-05-15.opensuse_leap42_3-x86_64'
74
+
INFO:spacewalk_channel_freeze:Cloning child-channel 'opensuse_leap42_3-x86_64-updates' as 'sp-2019-05-15.opensuse_leap42_3-x86_64-updates'
75
+
INFO:spacewalk_channel_freeze:Cloning child-channel 'opensuse_leap42_3-uyuni-client-x86_64' as 'sp-2019-05-15.opensuse_leap42_3-uyuni-client-x86_64'
76
+
```
77
+
78
+
Simulate freezing software channels for a particular host by supplying a label (*useful if you have multiple system groups and only want to clone a subset - check out the clone's names*); authentification is done using an auth file:
79
+
```
80
+
./spacewalk_channel_freeze.py -a admin.auth -S client -l q1-sap -n
81
+
INFO:spacewalk_channel_freeze:Supported API version (22) found.
82
+
INFO:spacewalk_channel_freeze:I'd like to clone base-channel 'opensuse_leap42_3-x86_64' as 'sp-q1-sap-2019-05-15.opensuse_leap42_3-x86_64'
83
+
INFO:spacewalk_channel_freeze:I'd like to clone child-channel 'opensuse_leap42_3-x86_64-updates' as 'sp-q1-sap-2019-05-15.opensuse_leap42_3-x86_64-updates'
84
+
INFO:spacewalk_channel_freeze:I'd like to clone child-channel 'opensuse_leap42_3-uyuni-client-x86_64' as 'sp-q1-sap-2019-05-15.opensuse_leap42_3-uyuni-client-x86_64'
85
+
INFO:spacewalk_channel_freeze:I'd like to remap client's base-channel from opensuse_leap42_3-x86_64 to sp-q1-sap-2019-05-15.opensuse_leap42_3-x86_64
86
+
INFO:spacewalk_channel_freeze:I'd like to set the following child-channels for client: ['sp-q1-sap-2019-05-15.opensuse_leap42_3-x86_64-updates', 'sp-q1-sap-2019-05-15.opensuse_leap42_3-uyuni-client-x86_64']
87
+
```
88
+
89
+
Unfreeze software channels for a host group with supplying a label and date. Keep in mind that you always need to specify dates if they differ from the current date (*e.g. you want to remove a clone you created a week ago*):
0 commit comments