Closed chsnell closed 4 years ago
This should work. Can you please try with a different parameter name, just in case there is some special handling in Katello and post the error in production.log?
Confirmed it fails with a generic parameter called 'foo' as well.
I think this is the relevant error section from production.log: 2019-11-04T20:13:50 [I|app|64390e6c] Started POST "/api/hostgroups/2/parameters" for 10.10.15.10 at 2019-11-04 20:13:50 -0500 2019-11-04T20:13:50 [I|app|64390e6c] Processing by Api::V2::ParametersController#create as JSON 2019-11-04T20:13:50 [I|app|64390e6c] Parameters: {"parameter"=>{"parameter_type"=>"string", "name"=>"foo", "value"=>"[FILTERED]"}, "apiv"=>"v2", "hostgroup_id"=>"2"} 2019-11-04T20:13:50 [W|app|64390e6c] Action failed ActiveModel::UnknownAttributeError: unknown attribute 'organization_id' for GroupParameter.
Ooh, that error is interesting.
@mdellweg did you ever see something like that before?
Ah! Can you apply the patch from https://github.com/theforeman/foreman/pull/7122 on your foreman and retry?
It seems to be a bug in 1.23, to be fixed in 1.23.1: https://projects.theforeman.org/issues/27740
No, i have never seen this. But i see, that it's a 500. So yes i agree, that it must be a server error.
Confirmed. That one line addition to app/controllers/api/base_controller.rb allows this to work now. Thanks much.
Great, closing then as it's not our bug :)
SUMMARY
I'm not sure if this is an issue with the foreman API or with this module. When creating a brand new hostgroup with foreman_hostgroup, or editing an existing one, if the kt_activation_keys parameter does not already exist, you will receive an Internal Server Error. Everything works fine, can even edit the parameter, if it does exist.
ISSUE TYPE
ANSIBLE VERSION
KATELLO/FOREMAN VERSION
APYPIE VERSION
STEPS TO REPRODUCE
This is a minimal task entry from a role that should work, provided you have all the variables filled out with valid values.
EXPECTED RESULTS
I expect the kt_activation_keys parameter to be created if it does not exist.
ACTUAL RESULTS