Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-add ability to rebuild #130

Closed
holmesb opened this issue Jul 14, 2023 · 1 comment · Fixed by #131
Closed

Re-add ability to rebuild #130

holmesb opened this issue Jul 14, 2023 · 1 comment · Fixed by #131
Assignees

Comments

@holmesb
Copy link
Contributor

holmesb commented Jul 14, 2023

Discussion resulted in agreement to reintroduce the ability to rebuild. This was removed in v6. New foreman_host argument set_build_flag will default to false. This will still allow the Foreman default behaviour of initially building new hosts, but will avoid the previous incarnation's (build) risk of accidental rebuilds after next Terraform run. Expectation of new behaviour vs current:

  • Now (v6): no set_build_flag argument exists, initial creation of foreman_host results in it being built, since this is the Foreman default. Re-running Terraform does not rebuild.
  • New: set_build_flag = false (default): This provider does not tell Foreman API to disable the build flag. Instead, due to the fact Foreman defaults to build = true, initial creation of foreman_host in Terraform still results in host being built. Re-running of Terraform will not rebuild.
  • New: set_build_flag = true: Initial creation of foreman_host results in it being built. Re-run of Terraform will rebuild. Changing back to false will prevent rebuild.
bitkeks added a commit to mindfulsecurity/terraform-provider-foreman that referenced this issue Jul 17, 2023
PR terraform-coop#122 removed the "build" argument, removing the possibility to
enforce setting the Foreman-internal build flag to "true". This commit
re-introduces this ability, but with a more explicit argument name:
"set_build_flag". And it defaults to "false", so that not specifying it
does not toggle the flag to "true" on accident.

Resolves terraform-coop#130

See terraform-coop#125
@bitkeks bitkeks self-assigned this Jul 17, 2023
@bitkeks
Copy link
Collaborator

bitkeks commented Jul 17, 2023

Re-run of Terraform will rebuild. Changing back to false will prevent rebuild

Please note that setting the set_build_flag argument in TF to true does not automatically re-install the host through Foreman. The flag will have an effect after the next reboot of the machine, because Foreman will then trigger the installation process again. This workflow is out of scope of Terraform.

bitkeks added a commit that referenced this issue Jul 19, 2023
PR #122 removed the "build" argument, removing the possibility to
enforce setting the Foreman-internal build flag to "true". This commit
re-introduces this ability, but with a more explicit argument name:
"set_build_flag". And it defaults to "false", so that not specifying it
does not toggle the flag to "true" on accident.

Resolves #130

See #125
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants