Closed Fodoj closed 3 years ago
I don't think this is correct. I checked the line for changes and current and old api documentation. The parameter has always been host_parameters_attributes
as far as I can tell. And I am using it in our production environment and have not yet had any issues with idempotency.
@lhw on update/create its host_parameter_attribute
s; on show its parameters
( see https://theforeman.org/api/2.0/apidoc/v2/hosts/show.html). Problem is that in current version it will just always send same parameters list and save them to statefile. But it will never detect changes to existing params (try changing some param manually in Foreman UI, then run terraform plan
), or newly manually added params (try adding new param outside of Terraform, and run plan
- it wont see there is a new param). Current version only compares with what is inside the statefile, which is always what you have defined in the template. But params from API are never retrieved for comparison.
Also see https://github.com/HanseMerkur/terraform-provider-foreman/pull/29/files#diff-1c2c1e4478457d1014e760b4b65a9a558e986d83eeeb398b77148dd7721598dbR173. It's once again one of those things where Foreman missed out on opportunity to provide consistent API.
Alright. That makes sense. We don't have anyone fiddling with the foreman ui. Just terraform these days.
Due to wrong API call, it never fetched the correct list of params, thus making idempotency none-existent