Updating Content Hosts with new Repository

Good afternoon,

I have created a new Product and Repository on our new Katello server and
subscribed to all our activation keys and content views etc, I can see the
repo showing in the Lifecycle Environments and everywhere except against
each of the hosts, and it looks like I need to manually go through each
host and subscribe this repo in.

Which seems to me that I am missing something here, is there an easier way
to have all the content hosts pick up the new repo?

Cheers,

Jasper

Jasper:

known working "cluebat" solution - resubscribe each machine to it's
activation key using
–force

developer recommended solution that sometimes doesn't work:
subscription-manager refresh

I've found that sometimes doing: yum clean all; subscription-manager
refresh has better results.

I would dearly like for subscription-manager refresh to work as advertised,
every time. But that's not been my experience. I would say it works ~70%

I have defaulted to trying that solution first, then going to activation
keys --force as a final option.

Cheers
L.

··· On 18 September 2017 at 12:51, Jasper Connery wrote:

Good afternoon,

I have created a new Product and Repository on our new Katello server and
subscribed to all our activation keys and content views etc, I can see the
repo showing in the Lifecycle Environments and everywhere except against
each of the hosts, and it looks like I need to manually go through each
host and subscribe this repo in.

Which seems to me that I am missing something here, is there an easier way
to have all the content hosts pick up the new repo?


"The antidote to apocalypticism is apocalyptic civics. Apocalyptic civics
is the insistence that we cannot ignore the truth, nor should we panic
about it. It is a shared consciousness that our institutions have failed
and our ecosystem is collapsing, yet we are still here — and we are
creative agents who can shape our destinies. Apocalyptic civics is the
conviction that the only way out is through, and the only way through is
together. "

Greg Bloom @greggish

Hey Lachlan,

Thanks for the reply. I was hoping there was an event I could trigger from
Katello itself without having to resubscribe…but oh well will go
ahead with this way.

Cheers!

··· On Monday, September 18, 2017 at 3:28:49 PM UTC+12, Lachlan Musicman wrote: > > > On 18 September 2017 at 12:51, Jasper Connery > wrote: > >> Good afternoon, >> >> I have created a new Product and Repository on our new Katello server and >> subscribed to all our activation keys and content views etc, I can see the >> repo showing in the Lifecycle Environments and everywhere except against >> each of the hosts, and it looks like I need to manually go through each >> host and subscribe this repo in. >> >> Which seems to me that I am missing something here, is there an easier >> way to have all the content hosts pick up the new repo? >> > > > Jasper: > > known working "cluebat" solution - resubscribe each machine to it's > activation key using > --force > > developer recommended solution that sometimes doesn't work: > subscription-manager refresh > > I've found that sometimes doing: yum clean all; subscription-manager > refresh has better results. > > I would dearly like for subscription-manager refresh to work as > advertised, every time. But that's not been my experience. I would say it > works ~70% > > I have defaulted to trying that solution first, then going to activation > keys --force as a final option. > > Cheers > L. > > > > ------ > "The antidote to apocalypticism is *apocalyptic civics*. Apocalyptic > civics is the insistence that we cannot ignore the truth, nor should we > panic about it. It is a shared consciousness that our institutions have > failed and our ecosystem is collapsing, yet we are still here — and we are > creative agents who can shape our destinies. Apocalyptic civics is the > conviction that the only way out is through, and the only way through is > together. " > > *Greg Bloom* @greggish > https://twitter.com/greggish/status/873177525903609857 > >

You can mass add licenses via webui in katello, you can't enable repositories though. You could use rex after subscribing the hosts to run subscription-manager refresh, or if you want to add license through shell directly run subscription-manager attach --pool=poolid, and after that you should be able to enable them using subscription-manager repos --enable=repoid

In any case the repo needs to be in content view+lifecycle env of the host before you do all this.

Greetings
Klaas Demter
ATIX - The Linux & Open Source Company

----- UrsprĂĽngliche Mail -----

··· Von: "Jasper Connery" An: "Foreman users" Gesendet: Montag, 18. September 2017 22:12:11 Betreff: Re: [foreman-users] Updating Content Hosts with new Repository

Hey Lachlan,

Thanks for the reply. I was hoping there was an event I could trigger from
Katello itself without having to resubscribe…but oh well will go
ahead with this way.

Cheers!

On Monday, September 18, 2017 at 3:28:49 PM UTC+12, Lachlan Musicman wrote:

On 18 September 2017 at 12:51, Jasper Connery <jcon...@gmail.com > <javascript:>> wrote:

Good afternoon,

I have created a new Product and Repository on our new Katello server and
subscribed to all our activation keys and content views etc, I can see the
repo showing in the Lifecycle Environments and everywhere except against
each of the hosts, and it looks like I need to manually go through each
host and subscribe this repo in.

Which seems to me that I am missing something here, is there an easier
way to have all the content hosts pick up the new repo?

Jasper:

known working “cluebat” solution - resubscribe each machine to it’s
activation key using
–force

developer recommended solution that sometimes doesn’t work:
subscription-manager refresh

I’ve found that sometimes doing: yum clean all; subscription-manager
refresh has better results.

I would dearly like for subscription-manager refresh to work as
advertised, every time. But that’s not been my experience. I would say it
works ~70%

I have defaulted to trying that solution first, then going to activation
keys --force as a final option.

Cheers
L.


"The antidote to apocalypticism is apocalyptic civics. Apocalyptic
civics is the insistence that we cannot ignore the truth, nor should we
panic about it. It is a shared consciousness that our institutions have
failed and our ecosystem is collapsing, yet we are still here — and we are
creative agents who can shape our destinies. Apocalyptic civics is the
conviction that the only way out is through, and the only way through is
together. "

Greg Bloom @greggish
https://twitter.com/greggish/status/873177525903609857

–
You received this message because you are subscribed to the Google Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send an email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

I know this is an old post but I am still experiencing the same issue with katello 3.16.0

subscription-manager refresh doesn’t work. The only way I found so the new yum repos are visible in my content hosts is to register them again with --force

Can you describe your setup and workflow that isn’t working in a bit more detail? Can you check if /etc/yum.repos.d/redhat.repo has the repositories you expect in it? If so, are they disabled?

1 Like

@ehelms the missing repository is not in /etc/yum.repos.d/redhat.repo

These are the packages in the server

[root@repos ~]# cat /etc/redhat-release 
CentOS Linux release 7.8.2003 (Core)

[root@repos ~]# rpm -qa |egrep "katello|foreman"
tfm-rubygem-foreman_ansible_core-3.0.3-1.fm2_1.el7.noarch
tfm-rubygem-foreman-tasks-2.0.2-1.fm2_1.el7.noarch
foreman-cli-2.1.2-1.el7.noarch
foreman-debug-2.1.2-1.el7.noarch
tfm-rubygem-hammer_cli_foreman_tasks-0.0.14-1.fm2_1.el7.noarch
rubygem-foreman_maintain-0.6.9-1.el7.noarch
tfm-rubygem-foreman_ansible-5.1.2-1.fm2_1.el7.noarch
tfm-rubygem-foreman_remote_execution_core-1.3.0-1.el7.noarch
repos.scicore.unibas.ch-foreman-proxy-1.0-1.noarch
katello-ca-consumer-katello-dmz.scicore-dmz.lan-1.0-1.noarch
katello-host-tools-fact-plugin-3.1.0-1.el7.noarch
foreman-release-2.1.2-1.el7.noarch
tfm-rubygem-hammer_cli_foreman_bootdisk-0.3.0-1.el7.noarch
katello-client-bootstrap-1.7.5-1.el7.noarch
tfm-rubygem-hammer_cli_katello-0.22.2-1.el7.noarch
foreman-postgresql-2.1.2-1.el7.noarch
foreman-installer-2.1.2-1.el7.noarch
katello-certs-tools-2.7.0-1.el7.noarch
foreman-dynflow-sidekiq-2.1.2-1.el7.noarch
foreman-release-scl-7-3.el7.noarch
katello-debug-3.16.0-1.el7.noarch
repos.scicore.unibas.ch-foreman-proxy-client-1.0-1.noarch
katello-repos-3.16.0-1.el7.noarch
foreman-proxy-2.1.2-1.el7.noarch
tfm-rubygem-foreman-tasks-core-0.3.4-1.fm2_1.el7.noarch
foreman-2.1.2-1.el7.noarch
tfm-rubygem-katello-3.16.0-1.el7.noarch
foreman-installer-katello-2.1.2-1.el7.noarch
katello-default-ca-1.0-1.noarch
repos.scicore.unibas.ch-foreman-client-1.0-1.noarch
tfm-rubygem-hammer_cli_foreman_docker-0.0.5-1.el7.noarch
foreman-selinux-2.1.2-1.el7.noarch
katello-3.16.0-1.el7.noarch
katello-server-ca-1.0-1.noarch
tfm-rubygem-hammer_cli_foreman-2.1.2-1.el7.noarch
pulp-katello-1.0.3-1.el7.noarch
tfm-rubygem-foreman_remote_execution-3.3.5-1.fm2_1.el7.noarch
katello-selinux-3.4.0-1.el7.noarch
tfm-rubygem-hammer_cli_foreman_ansible-0.3.2-1.fm2_1.el7.noarch
foreman-service-2.1.2-1.el7.noarch
katello-common-3.16.0-1.el7.noarch

these are the packages in the content host:

[root@slurm-worker-05 ~]# cat /etc/redhat-release 
CentOS Linux release 7.9.2009 (Core)

[root@slurm-worker-05 ~]# rpm -qa | egrep "foreman|katello"
katello-host-tools-3.5.3-1.el7.noarch
katello-ca-consumer-repos.scicore.unibas.ch-1.0-1.noarch
katello-host-tools-fact-plugin-3.5.3-1.el7.noarch
katello-host-tools-tracer-3.5.3-1.el7.noarch

Content host is attached to a CV default_cv_centos7_latest which uses an activation key default_centos7_latest_production

I have updated the CV to add a new yum repo centos7-security and then published a new version of the CV. I have also updated the subscriptions of the activation key to add the new yum repo centos7-security

After this when I execute subscription-manager refresh in the content host I cannot see the new yum repo centos7-security in /etc/yum.repos.d/redhat.repo

I have read that this information is refreshed every few hours so as I started with my tests yesterday I waited the full night and tried subscription-manager refresh this morning with no luck.

If in the content host I execute subscription-manager register --org="myorg" --activationkey="default_centos7_latest_production" --force then the yum repo centos7-security is added to /etc/yum.repos.d/redhat.repo

I double checked that the activation key default_centos7_latest_production is the one I am always using. I am not switching a different activation key but just forcing a registration using the same activation key

Let me know if you need any extra details or test.