You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add compatibility to "name" argument
The breaking change of making host.name read-only renders a lot of TF
configs unusable. This commit adds diff suppression handling to work
with name, shortname and fqdn even with older manifests.
* Remove deprecation of foreman_host.name attribute; extend README
The deprecation was meant to be an improvement but causes breaking
changes to many Terraform manifests. We removed the deprecation and
extended the README instead.
Copy file name to clipboardExpand all lines: README.md
+16
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,22 @@
2
2
3
3
Terraform provider to interact with [Foreman](https://www.theforeman.org/).
4
4
5
+
6
+
## Changes in 0.6.x
7
+
Starting with `v0.6.0` some (breaking) changes require an update of Terraform manifests.
8
+
9
+
* The host `build` argument was removed (`0.6.0`) and is replaced by `set_build_flag`. (`0.6.1`)
10
+
* The reason behind this change is complex and was thoroughly discussed in https://github.com/terraform-coop/terraform-provider-foreman/discussions/125
11
+
* Using the argument does one thing: it tells Foreman to set the `build` flag for a host. It defaults to `false`, setting it to `true` causes the host to be re-installed on next boot (network-based installation).
12
+
* The `method` argument is re-introduced as `provision_method`. It can be either `build` (network-based) or `image` (image-based).
13
+
* Both options require different additional arguments, e.g the image to be used. See `examples/host/`.
14
+
* The host `name` argument was considered for deprecation (`0.6.0`).
15
+
* The `name` attribute has issues based on the "append_domain_name" setting in Foreman. It causes "inconsistent plan" errors when you give it a shortname as value, Terraform receives an FQDN back, and the `name` attribute is then used in variables in other places in your Terraform manifests.
16
+
* As an alternative, the `shortname` argument can be used instead. It is meant for the hostname without the domain part. If you use `name` as input argument, `shortname` will be filled by the provider automatically.
17
+
* To get the host's FQDN from the provider, use the read-only attribute `fqdn`. (`0.6.1`)
18
+
***Use `shortname` and `fqdn` as variables in your manifests**! Example: `other_server = foreman_host.other_server.fqdn`. This will prevent you from running into inconsistent plans.
19
+
20
+
5
21
## Migration notice
6
22
7
23
The provider has moved from its previous location at https://github.com/terraform-coop/terraform-provider-foreman
-`architecture_id` - (Optional) ID of the architecture of this host
21
22
-`bmc_success` - (Optional) REMOVED - Tracks the partial state of BMC operations on host creation. If these operations fail, the host will be created in Foreman and this boolean will remain `false`. On the next `terraform apply` will trigger the host update to pick back up with the BMC operations.
22
23
-`comment` - (Optional) Add additional information about this host.Note: Changes to this attribute will trigger a host rebuild.
23
24
-`compute_attributes` - (Optional) Hypervisor specific VM options. Must be a JSON string, as every compute provider has different attributes schema
@@ -34,21 +35,26 @@ The following arguments are supported:
34
35
-`managed` - (Optional) Whether or not this host is managed by Foreman. Create host only, don't set build status or manage power states.
35
36
-`medium_id` - (Optional, Force New) ID of the medium mounted on the host.
36
37
-`model_id` - (Optional) ID of the hardware model if applicable
38
+
-`name` - (Optional, Force New) Name of this host as stored in Foreman. Can be short name or FQDN, depending on your Foreman settings (especially the setting 'append_domain_name_for_hosts').
37
39
-`operatingsystem_id` - (Optional, Force New) ID of the operating system to put on the host.
38
40
-`owner_id` - (Optional) ID of the user or usergroup that owns the host.
39
41
-`owner_type` - (Optional) Owner of the host, must be either User ot Usergroup
40
42
-`parameters` - (Optional) A map of parameters that will be saved as host parameters in the machine config.
41
43
-`provision_method` - (Optional, Force New) Sets the provision method in Foreman for this host: either network-based ('build') or image-based ('image')
44
+
-`ptable_id` - (Optional) ID of the partition table the host should use
42
45
-`puppet_class_ids` - (Optional) IDs of the applied puppet classes.
43
46
-`retry_count` - (Optional) Number of times to retry on a failed attempt to register or delete a host in foreman.
Deprecated: "[Deprecated. Use 'shortname' instead!]",
337
-
Description: "Name of this host as stored in Foreman. Can be short name or FQDN, depending on your Foreman settings (especially the setting 'append_domain_name_for_hosts').",
332
+
Type: schema.TypeString,
333
+
Computed: true,
334
+
Optional: true,
335
+
ForceNew: true,
336
+
Required: false,
337
+
Description: "Name of this host as stored in Foreman. Can be short name or FQDN, depending on your Foreman settings (especially the setting 'append_domain_name_for_hosts').",
0 commit comments