Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1126937 - Add @provisioning_type variable to tell when provisioning with a host group
Add @provisioning_type variable to tell when provisioning with a host group
Status: CLOSED WORKSFORME
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Provisioning Templates (Show other bugs)
6.0.4
Unspecified Unspecified
high Severity medium (vote)
: Beta
: Unused
Assigned To: Stephen Benjamin
Lukas Pramuk
http://projects.theforeman.org/issues...
: Reopened, Triaged
Depends On: 1220728 1337931
Blocks: 1122832 1098183 1126087
  Show dependency treegraph
 
Reported: 2014-08-05 11:56 EDT by Stephen Benjamin
Modified: 2018-11-02 09:16 EDT (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-06-07 10:17:40 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 6861 None None None 2016-04-22 11:02 EDT
Red Hat Product Errata RHSA-2015:1592 normal SHIPPED_LIVE Important: Red Hat Satellite 6.1.1 on RHEL 6 2015-08-12 05:04:35 EDT

  None (edit)
Description Stephen Benjamin 2014-08-05 11:56:02 EDT
A host group provisioned host won't have a token, so the call to foreman_url fails.  We should have a helper to know if we're provisioning by hostgroup/template or an actual host.
Comment 1 Stephen Benjamin 2014-08-05 11:56:04 EDT
Created from redmine issue http://projects.theforeman.org/issues/6861
Comment 2 Stephen Benjamin 2014-08-05 11:56:10 EDT
Upstream bug assigned to stbenjam@redhat.com
Comment 3 Stephen Benjamin 2014-08-05 12:01:25 EDT
This is needed in order to make Host Group provisioning fully work.

Upstream commit:
7d5aaa825a87d308650b6f3ebdea6bbef4f86dce
Comment 5 Bryan Kearney 2014-08-05 12:05:43 EDT
Moving to POST since upstream bug http://projects.theforeman.org/issues/6861 has been closed
-------------
Anonymous
Applied in changeset commit:7d5aaa825a87d308650b6f3ebdea6bbef4f86dce.
Comment 8 Corey Welton 2014-08-20 14:12:40 EDT
Marking this verified since group provisioning appears to be ok.

Satellite-6.0.4-RHEL-6-20140813.2
Comment 15 Peter Vreman 2015-02-25 03:16:55 EST
Confirmed that it works with 6.0.7, this issue can be closed.
Comment 16 Kedar Bidarkar 2015-03-16 08:08:03 EDT
1) created a host_group
2)associate katello kickstart default to a host-group
3) Deploy default PXE files
4) check the file on sat6  /var/lib/tftpboot/pxelinux.cfg/default

Rendering fails:

http://dhcp201-167.englab.pnq.redhat.com/unattended/template/Katello%20Kickstart%20Default/rhel66_grp

Get the below message when accessing the URL or provisioning.

There was an error rendering the Unnamed template: undefined method 'mac' for Hostgroup::Jail (Hostgroup)
Comment 17 Kedar Bidarkar 2015-03-16 08:09:50 EDT
TESTED with sat6.1 Beta snap6 compose2.
Comment 22 Kedar Bidarkar 2015-07-14 06:21:52 EDT
this bug depends on bug 1220728 which is marked for 6.2.0 and this for 6.1.1.
Comment 23 Bryan Kearney 2015-07-14 09:12:49 EDT
moving to 6.2
Comment 24 Peter Vreman 2015-07-17 14:02:10 EDT
The @provision_type works fine since 6.0.5 or so, we use it on a daily basis for at least 6 months.

The failure on the hostgroup jail that is cannot find the .mac is correct. The accessing of the .mac shall be done only when the @provision_type != hostgroup.

That means that this issue can be closed and then use the "@provision_type != hostgroup" feature to fix the BZ1220728
Comment 26 errata-xmlrpc 2015-08-12 01:13:28 EDT
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-2015:1592
Comment 27 sthirugn@redhat.com 2015-08-14 16:44:34 EDT
Accidentally closed with 6.1.1 errata
Comment 29 Lukas Pramuk 2016-06-06 07:24:16 EDT
FailedQA.

@satellite-6.2.0-14.2.el7sat.noarch

the behavior is the same as comment #16 had reported:

2016-06-06 06:25:02 [app] [I] Started GET "/unattended/template/Satellite%20Kickstart%20Default/My%20Hostgroup" for <CLIENT_IP> at 2016-06-06 06:25:02 -0400
2016-06-06 06:25:02 [app] [I] Processing by UnattendedController#hostgroup_template as HTML
2016-06-06 06:25:02 [app] [I]   Parameters: {"id"=>"Satellite Kickstart Default", "hostgroup"=>"My Hostgroup"}
2016-06-06 06:25:02 [app] [I]   Rendered inline template (71.7ms)
2016-06-06 06:25:02 [app] [W] There was an error rendering the Unnamed template: 
 | ActionView::Template::Error: undefined method 'mac' for Hostgroup::Jail (Hostgroup)
 | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.2.3/lib/safemode/jail.rb:17:in `method_missing'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.2.3/lib/safemode.rb:89:in `bind'
Comment 30 Bryan Kearney 2016-06-06 08:02:54 EDT
Upstream bug component is Provisioning Templates
Comment 31 Stephen Benjamin 2016-06-07 10:17:40 EDT
I'm just going to close this.  This variable was added over 2 years ago and working just fine since then - but QE wants to verify with the shipped Satellite templates which are always broken with HG provisioning due to other issues.  That's how long hostgroup provisioning has been broken in one fashion or another. 

If you really wanted to verify this, you could create a 1-line template

<%= @provisioning_type %>

and preview the template in a host group or host provsioning scenario, but imho it's a waste of QE's time.  

If users are using hostgroup provisioning, they need to write their own templates, and generally people should be directed to use PXEless discovery anyway.
Comment 32 Lukas Pramuk 2016-06-08 05:32:37 EDT
Then it's OK to close this.
But I need to move my failedqa to more proper bug then.

Moving to > BZ 1126087 
undefined method 'certname' for Hostgroup::Jail (customer reported)
undefined method 'mac' for Hostgroup::Jail (me reported)
Comment 33 Stephen Benjamin 2016-06-08 08:46:55 EDT
We can leave the bug open but not sure that we'll fix it - when I discussed with others on IRC, we agreed to keep HG provisioning as is and only fix regressions. Those errors aren't regressions since they never worked.  Users need to create their own basic templates for use with HG provisioning because it's such a limited feature.

The two errors -- certname is for puppet.conf and mac is from the networking snippet -- can't really work with HG provisioning anyway, you need a real host.

Note You need to log in before you can comment on or make changes to this bug.