Bug #6363
openKickstart template doesn't work for host group provisioning: undefined method 'info' for Hostgroup::Jail
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)"
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
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?
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.
Updated by Ohad Levy almost 10 years ago
Dominic Cleal wrote:
wont this add noise to the new template? for example, the following things will never work (maybe missed a couple):Not really, just fix the template.
- tokens
- realms
Updated by Dominic Cleal almost 10 years ago
Ohad Levy wrote:
Dominic Cleal wrote:
wont this add noise to the new template? for example, the following things will never work (maybe missed a couple):Not really, just fix the template.
- tokens
- realms
Indeed, what are you suggesting?
Updated by Ohad Levy almost 10 years ago
Dominic Cleal wrote:
I see 3 options, which one do you prefer:Ohad Levy wrote:
Dominic Cleal wrote:
wont this add noise to the new template? for example, the following things will never work (maybe missed a couple):Not really, just fix the template.
- tokens
- realms
Indeed, what are you suggesting?
- add checks if hostgroup or host provisioning to every code/snppet (realms, tokens, foreman_url)
- add a new template type for hostgroup based provisioning
- break down to more snippets, so the option above is a bit less painful to maintain
any other option?
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.
Updated by Anonymous almost 10 years ago
- Target version changed from 1.8.1 to 1.8.0
Updated by Anonymous almost 10 years ago
- Target version changed from 1.8.0 to 1.7.5
Updated by Stephen Benjamin almost 10 years ago
- Status changed from Assigned to Ready For Testing
- Assignee changed from Joseph Magen to Stephen Benjamin
Updated by Anonymous over 9 years ago
- Target version changed from 1.7.5 to 1.7.4
Updated by Anonymous over 9 years ago
- Target version changed from 1.7.4 to 1.7.3
Updated by Dominic Cleal over 9 years ago
- Target version changed from 1.7.3 to 1.7.2
Updated by Stephen Benjamin over 9 years ago
- Pull request https://github.com/theforeman/community-templates/pull/96 added
- Pull request deleted (
)
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.
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.
Updated by Lukas Zapletal over 8 years ago
- Related to Feature #11628: Check templates when associating with hostgroup added
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)
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.