Closed arielsalvo closed 8 years ago
@dLobatog can you think of the case where all_parameters wouldn't be correct? I remember a case where all_parameters was empty in early 1.10 since there were only params on the hostgroups but not but can't seem to reproduce it now.
If not we should just drop the manual resolution and totally rely on all_parameters.
@agx As far as I know all_parameters
is 100% reliable. The id
field though isn't easy to understand as you may have duplicate ids (e.g: param 'a' from a host has id 1, param 'b' from hostgroup has id 1 too as they don't come from the same source). That shouldn't affect this plugin though, so please merge at will :smile:
I'd totally be in favor of this too. Would save so much time and effort.
If appropriate, I can remove the option in the config file and move to all_parameters. Just say the word ;)
@arielsalvo thanks for the patch. I've pulled this in and removed the config variable.
I noticed the host returned by Foreman's API contains an
all_parameters
entry which contains Organization / Location / and global as well has host and group parameters. This would probably be enough to satisfy #9 . I added an optionserver_param_resolution
in the sectionforeman
of the ini file to make this change optional and backwards compatible; if missing or set to False, the original behavior is maintained.It would be nice to have a way to query all_parameters from the API itself instead of having to use the host.