Bug 1207044

Summary: [RFE] Allow through API methods to render templates without configuring a host in build mode
Product: Red Hat Satellite Reporter: Sergio G. <sgarciam>
Component: APIAssignee: Shlomi Zadok <szadok>
Status: CLOSED ERRATA QA Contact: Stephen Benjamin <stbenjam>
Severity: low Docs Contact:
Priority: unspecified    
Version: UnspecifiedCC: bkearney, djuran, sgarciam, stbenjam, sthirugn
Target Milestone: UnspecifiedKeywords: FutureFeature, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Linux   
URL: http://projects.theforeman.org/issues/11643
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-27 08:50:08 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 Sergio G. 2015-03-30 06:44:32 UTC
Description of problem:
If a host isn't in build mode, you cannot check if the kickstart template is rendered properly. Either you enable build mode and use http://sat6host/unattended/provision or you get an authentication cookie and use https://sat6host/unattended/provision?spoof=<hostname>. Both ways are tricky.


How reproducible:
Always


Steps to Reproduce:
1. Access to http://sat6host/unattended/provision from a host which is not in build mode and you won't get the template
2. Access to https://sat6.host/unattended/provision/?spoof=>hostname> and you will be redirected to login pages
3. No more methods to get it rendered


Expected results:
At least [1] should work, no matter the build status. Or it would be even better to have any API method to get it rendered.

Comment 1 RHEL Program Management 2015-03-30 07:03:28 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 3 Bryan Kearney 2015-09-01 17:19:06 UTC
Created redmine issue http://projects.theforeman.org/issues/11643 from this bug

Comment 5 Bryan Kearney 2015-11-04 11:05:13 UTC
Upstream bug assigned to szadok

Comment 6 Bryan Kearney 2015-11-19 15:05:43 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/11643 has been closed
-------------
Shlomi Zadok
Applied in changeset commit:8a817cb209c9499663beb850f7eb8f1726da42ad.

Comment 7 Bryan Kearney 2015-11-20 16:31:45 UTC
Move to 6.2 since this will be contained in the next rebase.

Comment 11 Stephen Benjamin 2016-07-15 13:18:48 UTC
Verified in Satellite 6.2 Snap 20.1. There's now an API to preview templates:


[root@sat-snap-rhel7 ~]# curl -u admin:changeme -H "Content-Type:application/json" -H "Accept:application/json"  https://sat-snap-rhel7.example.com/api/v2/hosts/centos7.example.com/template/provision

{"template":"\n\ninstall\nurl --url...[snip]

Comment 13 errata-xmlrpc 2016-07-27 08:50:08 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/RHBA-2016:1500