Bug 1347748

Summary: The templates proxy is hard to understand
Product: Red Hat Satellite Reporter: Stephen Benjamin <stbenjam>
Component: Foreman ProxyAssignee: Lukas Zapletal <lzap>
Status: CLOSED ERRATA QA Contact: Jan Hutaƙ <jhutar>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2.0CC: bkearney, cwelton, dmitri, ehelms, jhutar, lzap, nshaik, sokeeffe, spetrosi, stbenjam, swadeley
Target Milestone: 6.4.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Release Note
Doc Text:
In previous versions of Satellite, Satellite was able to retrieve templates from Capsules via the TFTP feature. Users were asked to enable TFTP and Templates modules on Capsules to have templating ability. Starting from Satellite 6.4, Satellite uses the Templates feature to retrieve templates from Capsules. During the upgrade, Satellite will automatically set the Templates feature for all Capsules that also have the TFTP feature. After the upgrade, verify that Templates feature is enabled for all Capsules that are supposed to have it. If not, navigate to *Infrastructure* > *Capsules* and click *Refresh Features* for all required Capsules. Then manually associate these Capsules with required subnets.
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-16 18:57:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Stephen Benjamin 2016-06-17 14:13:07 UTC
The 'Templates' feature was added to the foreman proxy so that clients could retrieve templates from their Capsule instead of the Satellite.  It was done by the Foreman team as part of their side of the capsule isolation feature. It works like this:

+-----------+
| Client    |
+-----+-----+
      |
      |  8000/http
+-----v-----+
| Capsule   |
+-----+-----+
      |
      |   443/https
+-----v-----+
| Satellite |
+-----------+

In all of our provisioning templates, we use a macro called foreman_url that is replaced with the appropriate URL. The Capsule URL is used for a host ONLY used when 3 conditions are true:

   1. The capsule supports TFTP
   2. The capsule's TFTP Feature is associated to the host's subnet
   3. The capsule also has the templates feature

This is very confusing for a number of edge cases. Generally, proxies relevant to a host are assigned directly - but individually.  The puppet CA, puppet master, openscap proxies, etc are all assigned each.  The magic was added to avoid having an explicit Templates association but I think we need it anyway.

No one intuitively understands this feature, and because it affects a number of features like boot disk, discovery, normal provisioning, etc.

Neither Boot disk ISO's nor finish templates use TFTP, why does this feature need to be enabled for them to work correctly with the template URL? Additionally, numerous users enable the feature on the Satellite and end up uselessly proxying their templates through the foreman-proxy service as well.

Comment 5 Dmitri Dolguikh 2017-01-16 11:16:32 UTC
FWIW, smart-proxy itself doesn't require tftp to be enabled in order for templates module to work.

Comment 6 Lukas Zapletal 2017-01-16 11:25:08 UTC
Not smart proxy, but there is a check in Foreman (foreman_url method) unfortunately. This is very confusing.

Comment 7 Satellite Program 2018-03-16 20:08:26 UTC
Upstream bug assigned to lzap

Comment 8 Satellite Program 2018-03-16 20:08:29 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/17316 has been resolved.

Comment 9 Sean O'Keeffe 2018-04-10 08:14:16 UTC
*** Bug 1395377 has been marked as a duplicate of this bug. ***

Comment 16 Bryan Kearney 2018-10-16 18:57:21 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:2927