Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

Commit bc41770

Browse files
authored
Update README.md
1 parent 6bce65c commit bc41770

File tree

1 file changed

+40
-20
lines changed

1 file changed

+40
-20
lines changed

README.md

Lines changed: 40 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# spacewalk_channel_freeze
22
`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.
34

45
# Implementation
56
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
89
2. Clone the appropriate channels
910
3. Assign the cloned channels to the affected systems
1011

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.
1213

1314
# 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*):
1516

1617
```
1718
$ echo -e "USERNAME\nPASSWORD" > spacewalk.auth
@@ -50,27 +51,46 @@ $ ./spacewalk_channel_freeze.py -a spacewalk.auth [...]
5051
| ``-D`` / ``--date`` | defines the date patches should be freezed (*default: current date*) |
5152

5253
# 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*):
5455
```
55-
$ ./satprep_patch_freeze.py -s tvm-spacewalk02.test.loc -S tvm-web01.test.loc -l "webtier"
56+
# ./spacewalk_channel_freeze.py -S client -n
5657
Satellite Username: admin
57-
Satellite Password:
58-
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']
6365
```
6466

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:
6668
```
67-
$ ./satprep_patch_freeze.py -s tvm-spacewalk02.test.loc -S tvm-web01.test.loc -l "webtier" -n -u -a spacewalk.auth
68-
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*):
90+
```
91+
# ./spacewalk_channel_freeze.py -a admin.auth -g sap-prod -l q1-sap -u -D 2019-02-15
92+
INFO:spacewalk_channel_freeze:Supported API version (22) found.
93+
INFO:spacewalk_channel_freeze:Deleting child-channel 'sp-q1-sap-2019-02-15.opensuse_leap42_3-x86_64-updates'
94+
INFO:spacewalk_channel_freeze:Deleting child-channel 'sp-q1-sap-2019-02-15.opensuse_leap42_3-uyuni-client-x86_64'
95+
INFO:spacewalk_channel_freeze:Deleting base-channel 'sp-q1-sap-2019-02-15.opensuse_leap42_3-x86_64'
7696
```

0 commit comments

Comments
 (0)