Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFE] create_host to succeed even if there is no environment_id attached to Host Group #93

Open
ericzolf opened this issue Jun 15, 2016 · 2 comments

Comments

@ericzolf
Copy link
Contributor

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

bootstrap-envid_patch.txt

@evgeni
Copy link
Member

evgeni commented Jun 16, 2016

bootstrap.py expects the HG to be set up properly: https://github.com/Katello/katello-client-bootstrap/blob/master/README.md#assumptions

if you do not have the HG set up to use puppet, you can skip it completelly with --skip-puppet

@ericzolf
Copy link
Contributor Author

ericzolf commented Jun 20, 2016

Hi Evgeni,

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 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants