Feature #20895

provisiong template @mediapath is static and not picking up content source from host

Added by Oliver Weinmann 8 months ago. Updated 7 months ago.

Status:New
Priority:Normal
Assigned To:Partha Aji
Category:-
Target version:Team Brad - Backlog
Difficulty: Pull request:
Bugzilla link:
Story points-
Velocity based estimate-
ReleaseKatello 3.3.2Release relationshipAuto

Description

Hi,

while deploying a fresh host via Katello in our DMZ I noticed that it tries to pull the intall files from the main katello server instead of the capsule selected under content source. I figured that in the provisioning template @mediapath is somehow static and pointing to the main katello server. As I usually do when facing problems with Katello I joined the IRC chat and immediatley got an answer with a workaround that works perfectly.

I replaced <%= @mediapath %> in the kickstart provisioning template with:

<%= @mediapath.gsub(foreman_server_fqdn.to_s, @host.content_source.to_s) %>

and now mediapath points to the selected content source.

katello_centos7-newhost.PNG (36.5 KB) Preview Oliver Weinmann, 09/21/2017 04:25 AM

repodetails.PNG (60.4 KB) Preview Oliver Weinmann, 09/21/2017 05:17 AM

hostgroup_1.PNG (38 KB) Preview Oliver Weinmann, 09/21/2017 05:20 AM

hostgroup_2.PNG (45 KB) Preview Oliver Weinmann, 09/21/2017 05:42 AM

Katello_centos7-newhost Repodetails Hostgroup_1 Hostgroup_2

History

#1 Updated by Andrew Kofink 8 months ago

  • Assigned To set to Partha Aji
  • Release set to Katello 3.5.0

#2 Updated by Brad Buckingham 8 months ago

  • Target version set to Team Brad - Iteration 21

#3 Updated by Partha Aji 8 months ago

Can you provide me the following details
1) OS Family of the OS you were trying to provision
2) The template you tweaked the media path.

#4 Updated by Partha Aji 8 months ago

Can you also
3) provide the version and arch.
4) make sure you have synced/published the KS trees in the right cv/env.
5) make sure the repositories have bootable distributions created out of them by going to repo details UI page and getting the distribution info. (please paste that info too)

#5 Updated by Oliver Weinmann 8 months ago

Hi,

sorry for not giving you all the details. I have to admit that I don't have the latest Katello installed, so maybe this problem is already solved? I'm on Katello 3.3.2 right now and currently I can't upgrade to a later release since we still have Windows 2008 R2 DHCP servers and they are no longer supported in a higher Katello release.

[root@katello ~]# rpm -qa katello
katello-3.3.2-1.el7.noarch

To your questions:

1) OS Family of the OS you were trying to provision
- Red Hat
2) The template you tweaked the media path.
- https://github.com/theforeman/community-templates/blob/develop/provisioning_templates/provision/kickstart_default.erb.
3) provide the version and arch.
- CentOS 7.3
4) make sure you have synced/published the KS trees in the right cv/env.
- Yep
5) make sure the repositories have bootable distributions created out of them by going to repo details UI page and getting the distribution info. (please paste that info too)
- see screenshot repodetails

I just checked and my problem might be that when creating a new host (CentOS 7.4) under the operating system tab, synced content is greyed out and so all media is selected instead. I figured that "synced content" is dynamic and "all media" is static. Recently I decided to just sync the CentOS 7 repo which is a symlink that always points to the latest release instead of creating a hostgroup,cv and so on for every new Centos 7.x release. On the newly synced CentOS 7 product synced content is no longer greyed out and deploying a host now works without tweaking the prov template. So the problem was truly that I could not select synced content. But since I use hostgroups e.g. like:

Server/Library/Linux/CentOS 7 <- There I can select synced content
Server/Library/Linux/CentOS 7/ad <- Synced content is greyed out (This hostgroup has a few more puppet modules to handle winbind configuration)

So any hostgroup that inherits operating system from a parent hostgroup has installation media greyed out. See screenshot hostgroup_1 and hostgroup_2. Sometimes by changing the settings in the sub hostgroup back and forth synced media becomes available but it's really unpredictable. Is this a known bug?

Best Regards,
Oliver

#6 Updated by Brad Buckingham 8 months ago

  • Target version changed from Team Brad - Iteration 21 to Team Brad - Iteration 22

#7 Updated by Partha Aji 7 months ago

Re:
"""
So any hostgroup that inherits operating system from a parent hostgroup has installation media greyed out. See screenshot hostgroup_1 and hostgroup_2. Sometimes by changing the settings in the sub hostgroup back and forth synced media becomes available but it's really unpredictable. Is this a known bug?
"""

I believe your issue was resolved by http://projects.theforeman.org/issues/20249 and fixed as part of Katello 3.4.4

#8 Updated by Brad Buckingham 7 months ago

  • Target version changed from Team Brad - Iteration 22 to Team Brad - Backlog

Also available in: Atom PDF