Skip to content
This repository has been archived by the owner on Feb 5, 2020. It is now read-only.

ignition_systemd_unit argument 'enable' hard depreciated by Terraform Ignition Provider in v1.0 #2025

Closed
nreisbeck opened this issue Sep 30, 2017 · 1 comment

Comments

@nreisbeck
Copy link

BUG REPORT

Versions

What happened?

Terraform fails to successfully terraform plan due to an "invalid or unknown key: enable" for module.*.data.ignition_systemd_unit.*

AWS:

20 error(s) occurred:
* module.bootkube.data.ignition_systemd_unit.bootkube_path_unit: : invalid or unknown key: enable
* module.bootkube.data.ignition_systemd_unit.bootkube_service: : invalid or unknown key: enable
* module.etcd.data.ignition_systemd_unit.etcd_unzip_tls: : invalid or unknown key: enable
* module.etcd.data.ignition_systemd_unit.locksmithd: : invalid or unknown key: enable
* module.ignition_masters.data.ignition_systemd_unit.coreos_metadata: : invalid or unknown key: enable
* module.ignition_masters.data.ignition_systemd_unit.docker_dropin: : invalid or unknown key: enable
* module.ignition_masters.data.ignition_systemd_unit.etcd: : invalid or unknown key: enable
* module.ignition_masters.data.ignition_systemd_unit.init_assets: : invalid or unknown key: enable
* module.ignition_masters.data.ignition_systemd_unit.k8s_node_bootstrap: : invalid or unknown key: enable
* module.ignition_masters.data.ignition_systemd_unit.kubelet: : invalid or unknown key: enable
* module.ignition_masters.data.ignition_systemd_unit.tx_off: : invalid or unknown key: enable
* module.ignition_workers.data.ignition_systemd_unit.coreos_metadata: : invalid or unknown key: enable
* module.ignition_workers.data.ignition_systemd_unit.docker_dropin: : invalid or unknown key: enable
* module.ignition_workers.data.ignition_systemd_unit.init_assets: : invalid or unknown key: enable
* module.ignition_workers.data.ignition_systemd_unit.k8s_node_bootstrap: : invalid or unknown key: enable
* module.ignition_workers.data.ignition_systemd_unit.kubelet: : invalid or unknown key: enable
* module.ignition_workers.data.ignition_systemd_unit.tx_off: : invalid or unknown key: enable
* module.masters.data.ignition_systemd_unit.init_assets: : invalid or unknown key: enable
* module.tectonic.data.ignition_systemd_unit.tectonic_path: : invalid or unknown key: enable
* module.tectonic.data.ignition_systemd_unit.tectonic_service: : invalid or unknown key: enable

DigitalOcean (WIP)(#604):

4 error(s) occurred:
* module.etcd.data.ignition_systemd_unit.etcd3[0]: : invalid or unknown key: enable
* module.etcd.data.ignition_systemd_unit.etcd3[1]: : invalid or unknown key: enable
* module.etcd.data.ignition_systemd_unit.etcd3[2]: : invalid or unknown key: enable
* module.etcd.data.ignition_systemd_unit.locksmithd: : invalid or unknown key: enable

Terraform

Terraform Ignition Provider:

v0.1.0 ignition_systemd_unit had enable
v0.2.0 ignition_systemd_unit had enable
v1.0 ignition_systemd_unit replaced enable with enabled.

Between the Sept. 5th release of v0.2.0 and the Sept 13th release of v1.0, the 'implementation' of the Ignition Config 2.1 types as well as resources and properties was done, and enable was changed to enabled, as well as the validation for adherence to schema, or schema according to the Terraform Ignition Provider's implementation of the schema.

Ignition

Ignition Configs:

v1.0-v2.0 Systemd had a SystemdUnit struct for Enable.
v2.1 The Systemd Unit brings support for Enabled as well, while maintaining backward compatibility for Enable.

Ignition Documentation:

v2.0.0 systemd had an enable method.
v2.1.0 depreciated the enable method in favor of enabled.
v2.2.0 (Experimental) still has this marked as DEPRECIATED however wherein the Ignition struct Enable and Enabled are both still in place, it was switched with no backwards compatibility (See: terraform-providers/terraform-provider-ignition/website/docs/d/systemd_unit.html.md and terraform-providers/terraform-provider-ignition/ignition/resource_ignition_systemd_unit.go

This hard cutover was pretty poorly communicated, noting in the change log simply, "remove deprecate resources in favor of data resources", although there does appear to be a brief discussion in the PR for the implementation of the Ignition Config 2.1 spec. With a minor objection and request raised by @s-urbaniak, to implement the depreciated resources properly and to spec, since they are only depreciated in the Ignition spec.

What you expected to happen?

While I do appreciate the desire to cut a clean release of the code for the v1.0 release of the Terraform Ignition Provider, I do also expect the implementation of the provider to adhere to the spec of Ignition as closely as possible, as well as changes that may deviate or break the spec to be more throughly documented and explicitly referenced.

I understand this is outside of the control of the maintainers of Tectonic at this point until resolved upstream, however I wanted to raise the issue to make it known that keeping the Ignition version = "0.1.0" that is in config.tf by default appears to be the best course of action for the time being.

How to reproduce it (as minimally and precisely as possible)?

Change the Ignition provider in config.tf >=1.0 or omit it. The latest version will be pulled.

Anything else we need to know?

While I probably wrote a few too many words about the issue, the default value for Enable/Enabled is true by default. Putting enable/enabled = true into any ignition_systemd_unit data block to me, seems to be redundant and unnecessary code by virtue of the block existing it is already enabled.

This does present some issues, and I do see a use case for enable[d] = "${var.foo != "" ? true : false}"

The following modules:
modules/ignition/assets.tf
modules/aws/master_asg/igniton.tf

Use the enable[d] method for the ignition_systemd_unit.init_assets data source as a boolean conditional for the init_assets location being not blank (the default value).

The two following modules:
modules/bootkube/assets.tf
modules/tectonic/assets.tf

Both use ignition_systemd_unit.tectonic_service enable = false as a default behavior, so there doesn't appear to be a clean solution without pushing this upstream for a resolution to support the depreciated option until at such time as it depreciated by Tectonic completely.

I do have a pull request available that will remove all of the enable=true behavior as this does make any breaking changes to the two platforms (AWS & Digital Ocean) that I have and am able to test.

Further feedback appreciated, and I will likely open an issue on the Terraform Ignition provider repo to solicit some feedback from there as well.

@nreisbeck nreisbeck changed the title ignition_systemd_unit argument 'enable' hard depreciated in v2.0 ignition_systemd_unit argument 'enable' hard depreciated by Terraform Ignition Provider in v1.0 Sep 30, 2017
@nreisbeck
Copy link
Author

I see this was already discussed further and acknowledged here.

Closing issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant