Closed displague closed 3 years ago
The instruction to create an SSH key by hand https://github.com/equinix/terraform-metal-openstack#deployment-prep, can be avoided by generating the key with Terraform: https://github.com/equinix/terraform-metal-anthos-on-baremetal/blob/v0.3.0/main.tf#L30-L44
In this way, the SSH key will be registered in userdata and configured by cloud-init.
Lines such as these (which add the SSH key contents to userdata directly) will not be necessary: https://github.com/equinix/terraform-metal-openstack/blob/4c4f30b7e2cd76f9fa19b41d2d3289889b04d500/BareMetal.tf#L22
Instances of key copying can create the remote file using the content property instead of file, following the same pattern found in the anthos project. https://github.com/equinix/terraform-metal-openstack/blob/4c4f30b7e2cd76f9fa19b41d2d3289889b04d500/DistributeKeys.tf#L16-L19
content
file
We can also remove these instructions if we adapt this behavior: https://github.com/equinix/terraform-metal-openstack#ensure-that-your-equinix-metal-account-has-an-ssh-key-attached
The requirement to create an ssh manually makes it harder to integrate this as a module and it is a missing step in our GitHub action.
Closed by #51
The instruction to create an SSH key by hand https://github.com/equinix/terraform-metal-openstack#deployment-prep, can be avoided by generating the key with Terraform: https://github.com/equinix/terraform-metal-anthos-on-baremetal/blob/v0.3.0/main.tf#L30-L44
In this way, the SSH key will be registered in userdata and configured by cloud-init.
Lines such as these (which add the SSH key contents to userdata directly) will not be necessary: https://github.com/equinix/terraform-metal-openstack/blob/4c4f30b7e2cd76f9fa19b41d2d3289889b04d500/BareMetal.tf#L22
Instances of key copying can create the remote file using the
content
property instead offile
, following the same pattern found in the anthos project. https://github.com/equinix/terraform-metal-openstack/blob/4c4f30b7e2cd76f9fa19b41d2d3289889b04d500/DistributeKeys.tf#L16-L19We can also remove these instructions if we adapt this behavior: https://github.com/equinix/terraform-metal-openstack#ensure-that-your-equinix-metal-account-has-an-ssh-key-attached