Project

General

Profile

Actions

Bug #6363

open

Kickstart template doesn't work for host group provisioning: undefined method 'info' for Hostgroup::Jail

Added by Dominic Cleal almost 10 years ago. Updated over 8 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Templates
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

(from https://bugzilla.redhat.com/show_bug.cgi?id=1098183#c9)

1. Created a host group with a dot in the name [new.host]
2. Created a kickstart with a dot in the name [Satellite Kickstart Default for RHEL.v2] which has content same as "Satellite Kickstart Default for RHEL"
3. Associated the kickstart template with the host group, via "provision templates" -> <template name> -> Association -> "Add Combination".
4. Generated the PXE default menu by clicking the 'Build PXE Default' button
5. Moved to /var/lib/tftpboot/pxelinux.cfg on the smartproxy and opened the default file.
6. Tried accessing the link via the browser, https://dhcp201-170.englab.pnq.redhat.com/unattended/template/Satellite%20Kickstart%20Default%20for%20RHEL.v2/new.host

But get the below messsage,

"There was an error rendering the template: undefined method 'info' for Hostgroup::Jail (Hostgroup)"


Related issues 1 (1 open0 closed)

Related to Foreman - Feature #11628: Check templates when associating with hostgroupNew09/01/2015Actions
Actions #1

Updated by Joseph Magen almost 10 years ago

  • Status changed from New to Assigned
  • Assignee set to Adam Heinz
  • Target version set to 1.8.1
Actions #2

Updated by Joseph Magen almost 10 years ago

  • Assignee changed from Adam Heinz to Joseph Magen

Is this still a bug if the template is not designed for host group-based provisioning?

I assume we should generated a better error message?

Actions #3

Updated by Dominic Cleal almost 10 years ago

Joseph Magen wrote:

Is this still a bug if the template is not designed for host group-based provisioning?

Yes, it's our template.

I assume we should generated a better error message?

Not really, just fix the template.

Actions #4

Updated by Ohad Levy almost 10 years ago

Dominic Cleal wrote:

Not really, just fix the template.

wont this add noise to the new template? for example, the following things will never work (maybe missed a couple):
  • tokens
  • realms
Actions #5

Updated by Dominic Cleal almost 10 years ago

Ohad Levy wrote:

Dominic Cleal wrote:

Not really, just fix the template.

wont this add noise to the new template? for example, the following things will never work (maybe missed a couple):
  • tokens
  • realms

Indeed, what are you suggesting?

Actions #6

Updated by Ohad Levy almost 10 years ago

Dominic Cleal wrote:

Ohad Levy wrote:

Dominic Cleal wrote:

Not really, just fix the template.

wont this add noise to the new template? for example, the following things will never work (maybe missed a couple):
  • tokens
  • realms

Indeed, what are you suggesting?

I see 3 options, which one do you prefer:
  1. add checks if hostgroup or host provisioning to every code/snppet (realms, tokens, foreman_url)
  2. add a new template type for hostgroup based provisioning
  3. break down to more snippets, so the option above is a bit less painful to maintain

any other option?

Actions #7

Updated by Dominic Cleal almost 10 years ago

I prefer (1), plus (3) if that makes it easier. I don't think the changes required are too extensive.

Actions #8

Updated by Anonymous almost 10 years ago

  • Target version changed from 1.8.1 to 1.8.0
Actions #9

Updated by Anonymous almost 10 years ago

  • Target version changed from 1.8.0 to 1.7.5
Actions #10

Updated by Stephen Benjamin almost 10 years ago

  • Status changed from Assigned to Ready For Testing
  • Assignee changed from Joseph Magen to Stephen Benjamin
Actions #11

Updated by Anonymous over 9 years ago

  • Target version changed from 1.7.5 to 1.7.4
Actions #12

Updated by Anonymous over 9 years ago

  • Target version changed from 1.7.4 to 1.7.3
Actions #13

Updated by Dominic Cleal over 9 years ago

  • Target version changed from 1.7.3 to 1.7.2
Actions #14

Updated by Stephen Benjamin over 9 years ago

  • Pull request https://github.com/theforeman/community-templates/pull/96 added
  • Pull request deleted ()
Actions #15

Updated by Stephen Benjamin over 9 years ago

The solution in the above PR is to create a new helper called "host_provision" which will be true in non-hostgroup provisioning. As Ohad mentioned above, this takes care of the two issues - relams and tokens.

There is an additional issue in the puppet.conf snippet which calls `certname`, so I've got a check in there - for hostgroup-based provisioning, it'll replace it with $HOSTNAME, so if the hostname is set then we'll configure it correctly.

That seems to get things up and going for me.

Note these templates will only be compatible with 1.5 and 1.6.

Actions #16

Updated by Lukas Zapletal about 9 years ago

  • Bugzilla link deleted (1098183)

The BZ link was wrong, it was a different one. But we definitely need to get this downstream. Stephen, are you aware of existing downstream BZ? If not, I will create/assign to one.

Actions #17

Updated by Lukas Zapletal over 8 years ago

  • Related to Feature #11628: Check templates when associating with hostgroup added
Actions #18

Updated by Dominic Cleal over 8 years ago

  • Status changed from Ready For Testing to New
  • Assignee deleted (Stephen Benjamin)
  • Target version deleted (1.7.2)
  • Pull request added
  • Pull request deleted (https://github.com/theforeman/community-templates/pull/96)
Actions #19

Updated by Stephen Benjamin over 8 years ago

I don't think so, just #6861 had a bugzilla. I'd just let this whole thing die and tell HG provisioning users to write their own KS.

Actions

Also available in: Atom PDF