Skip to content
This repository has been archived by the owner on Jul 23, 2019. It is now read-only.

Rewrite terraform to support dynamic number of nodes #47

Merged
merged 1 commit into from
Apr 18, 2019

Conversation

yrobla
Copy link
Contributor

@yrobla yrobla commented Apr 16, 2019

Change the data structure to accept data of nodes using maps.
This will allow to add a variable number of masters (1,3) in the future.
Added a new dependency on rodaine/hclencoder, to render terraform data
in HCL instead of JSON, to avoid a bug in JSON parsing:
hashicorp/terraform#15549

Copy link
Member

@stbenjam stbenjam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get some errors trying to run this - it looks like the main.tf in the root of the directory was overwritten by the one that should be in masters/

level=error msg="Error: resource 'ironic_node_v1.openshift-master' count: unknown variable referenced: 'master_nodes'; define it with a 'variable' block"
level=error
level=error
level=error
level=error msg="Error: resource 'ironic_node_v1.openshift-master' config: unknown variable referenced: 'image_source'; define it with a 'variable' block"
level=error
level=error
level=error
level=error msg="Error: resource 'ironic_node_v1.openshift-master' config: unknown variable referenced: 'root_gb'; define it with a 'variable' block"
level=error

data/data/baremetal/variables-baremetal.tf Outdated Show resolved Hide resolved
pkg/tfvars/baremetal/baremetal.go Outdated Show resolved Hide resolved
data/data/baremetal/main.tf Outdated Show resolved Hide resolved
@yrobla yrobla force-pushed the rewrite_terraform branch 4 times, most recently from d965631 to 08f62c8 Compare April 16, 2019 15:40
Copy link
Member

@stbenjam stbenjam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise this looks good. I get past the masters install so I think this is all working

pkg/tfvars/baremetal/baremetal.go Outdated Show resolved Hide resolved
Change the data structure to accept data of nodes using maps.
This will allow to add a variable number of masters (1,3) in the future.
Added a new dependency on rodaine/hclencoder, to render terraform data
in HCL instead of JSON, to avoid a bug in JSON parsing:
hashicorp/terraform#15549
Copy link

@hardys hardys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally and this works for me with the default 3 masters, not tested with 1 yet

@hardys hardys merged commit 3e17e2e into openshift-metal3:master Apr 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants