Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce a new redhat-cloud-client-configuration-cdn binary package #15

Merged
merged 4 commits into from
Jan 17, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: drop repository disabling from cdn package
The redhat-cloud-client-configuration-cdn binary package will ensure
that the registered system will fetch the content from the default CDN
configured in subscription-manager. Hence, drop the bits from the
%post and %postun scriptlets of the package that tweak the
"manage_repos" configuration option of subscription-manager.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
ptoscano committed Jan 14, 2025
commit 2b7b6e05184c5e53b7078ae4c58209d8ba72a37a
25 changes: 2 additions & 23 deletions redhat-cloud-client-configuration.spec
Original file line number Diff line number Diff line change
@@ -255,16 +255,8 @@ if [ $1 -eq 1 ]; then
auto_reg_enabled=0
fi

# Try to get current value of manage_repos
subscription-manager config --list | grep -q '^[ \t]*manage_repos[ \t]*=[ \t]*0'
if [ $? -eq 0 ]; then
manage_repos_enabled=0
else
manage_repos_enabled=1
fi

# When we are going to change any configuration value, then save original rhsm.conf
if [ $auto_reg_enabled -eq 0 -o $manage_repos_enabled -eq 1 ]; then
if [ $auto_reg_enabled -eq 0 ]; then
echo -e "#\n# Automatic backup of rhsm.conf created by %{name}-cdn installation script\n#\n" \
> /etc/rhsm/rhsm.conf.cloud_save
cat /etc/rhsm/rhsm.conf >> /etc/rhsm/rhsm.conf.cloud_save
@@ -275,14 +267,8 @@ if [ $1 -eq 1 ]; then
subscription-manager config --rhsmcertd.auto_registration=1
fi

# Disable management of redhat.repo on systems running in
# public cloud, because content is provided by RHUI
if [ $manage_repos_enabled -eq 1 ]; then
subscription-manager config --rhsm.manage_repos=0
fi

# Restart rhsmcertd to reload configuration file, when it is necessary
if [ $auto_reg_enabled -eq 0 -o $manage_repos_enabled -eq 1 ]; then
if [ $auto_reg_enabled -eq 0 ]; then
/bin/systemctl restart rhsmcertd.service
fi
fi
@@ -329,13 +315,6 @@ if [ $1 -eq 0 ]; then
rhsmcertd_restart_required=1
fi

# When managing was originally enabled, then enable it again
grep -q '^[ \t]*manage_repos[ \t]*=[ \t]*1' /etc/rhsm/rhsm.conf.cloud_save
if [ $? -eq 0 ]; then
subscription-manager config --rhsm.manage_repos=1
rhsmcertd_restart_required=1
fi

# Restart rhsmcertd to propagate change in rhsm.conf
if [ $rhsmcertd_restart_required -eq 1 ]; then
%systemd_postun_with_restart rhsmcertd.service