terraform-coop / terraform-provider-foreman

Terraform provider for Foreman
https://registry.terraform.io/providers/terraform-coop/foreman
Mozilla Public License 2.0
33 stars 31 forks source link

Implement settings API as data source #120

Closed bitkeks closed 11 months ago

bitkeks commented 1 year ago

Implements the API calls for ReadSetting and QuerySetting, allowing a read-only usage of the Foreman settings API.

As an example, the setting "append_domain_name_for_hosts" is read in the resourceForemanHostCreate func to handle the issue with short names and FQDNs as return value.

Refs #116

agriffit79 commented 1 year ago

Thanks for the PR! One minor note - in my Foreman test version (3.5.1) the full_name field is populated. But it doesn't add much value as it looks to be pretty much a duplicate of name.

bitkeks commented 12 months ago

Commit 92655dd updates the branch with tests and cleanups.

@lhw the test suite is quite verbose and complicated, no? I cannot figure out how the values behind RandForemanSetting in combination with ForemanSettingToInstanceState has any connection to the JSON test data.