You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As the subject says, create_host fails with an error that a null environment_id isn't acceptable.
Adding the following two lines solved the issue for me, but it sounds slightly ugly, because it assumes an ID of 1 for production, and I don't know if there are no side effects if the Puppet environment of the created host is set "forcefully" to production:
if (return_puppetenv_for_hg(return_matching_foreman_key('hostgroups', 'title="%s"' % options.hostgroup, 'id', False)) == "production"):
jsondata['host']['environment_id'] = 1 # Assuming production's ID is 1
I'm fine with the fact that it's working as it should (it's not a bug, it's a feature), but it doesn't mean we can't change the way it works, and I think that there are customers using Puppet only for gathering facts, in which case, it doesn't make sense to care about the Puppet environment.
OK, I've rephrased it as RFE.
KR, Eric
ericzolf
changed the title
create_host fails if there is no environment_id attached to Host Group
[RFE] create_host to succeed even if there is no environment_id attached to Host Group
Jun 20, 2016
As the subject says, create_host fails with an error that a null environment_id isn't acceptable.
Adding the following two lines solved the issue for me, but it sounds slightly ugly, because it assumes an ID of 1 for production, and I don't know if there are no side effects if the Puppet environment of the created host is set "forcefully" to production:
bootstrap-envid_patch.txt
The text was updated successfully, but these errors were encountered: