As mentioned in #116 the "name" field is problematic in Foreman. The setting "append_domain_name_for_hosts" converts a short hostname into an FQDN. This leads to "inconsistent plan" errors in Terraform.
In earlier versions, a custom unmarshaller removed the domain part from the name attribute:
In this case, Foreman always used the FQDN internally, but Terraform received only the shortname in return and had no issues. Since this function is removed, the conflict appears.
For expected behaviour and consistency I propose a switch to "fqdn" and "shortname" instead of the "name" attribute. This PR is the implementation.
The result will look like this:
name: Read-only, used in Foreman API as a unique name for a host. Can be either the short name or the expanded FQDN, depending on the respective Foreman setting.
shortname: The "new" "name" argument that you should use in Terraform for your hosts. In combination with the domain_id Foreman knows what the domain part should be.
fqdn: Read-only, only exists in the Terraform provider. Is constructed from the name received from Foreman. Can be used as a consistent variable value in other parts of the Terraform module files and blocks.
As mentioned in #116 the "name" field is problematic in Foreman. The setting "append_domain_name_for_hosts" converts a short hostname into an FQDN. This leads to "inconsistent plan" errors in Terraform.
In earlier versions, a custom unmarshaller removed the domain part from the name attribute:
In this case, Foreman always used the FQDN internally, but Terraform received only the shortname in return and had no issues. Since this function is removed, the conflict appears.
For expected behaviour and consistency I propose a switch to "fqdn" and "shortname" instead of the "name" attribute. This PR is the implementation.
The result will look like this:
name
: Read-only, used in Foreman API as a unique name for a host. Can be either the short name or the expanded FQDN, depending on the respective Foreman setting.shortname
: The "new" "name" argument that you should use in Terraform for your hosts. In combination with thedomain_id
Foreman knows what the domain part should be.fqdn
: Read-only, only exists in the Terraform provider. Is constructed from the name received from Foreman. Can be used as a consistent variable value in other parts of the Terraform module files and blocks.