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

Template terraform using a basic inventory #238

Closed
wants to merge 17 commits into from
Closed

Conversation

sjpb
Copy link
Collaborator

@sjpb sjpb commented Nov 23, 2022

Currently the "inputs" to the cluster are split between TF and ansible variables. Moving everything to ansible - by templating TF from ansible - unifies inputs, avoiding problems where e.g. userdata really needs inputs from both ansible and terraform.

Two differences from the CaaS approach (which I'd envisage moving to this once AWX goes and CaaS is merged with this):

  1. The files environments/{common,arcus}/cluster.yml define the infrastructure, and are actual ansible inventory files. This:
  • Gives a simple/single place to define the cluster for an environment.
  • Means hosts are defined before any provisioning, which means group and hostvars can be used when templating terraform (rather than just all groupvars). This enables simple variation between hosts e.g. for volumes, userdata, networks/ports. It will in future (with some changes to the OpenHPC role) allow environment-specific image build without having to provision a cluster first to define e.g. the slurm control nodename.
  • Allows using ansible hostpatterns to define sequential compute names, while still also allowing arbitrary names.
  1. The community.general.terraform role is wrapped to (by-default) require user confirmation before making changes.

This refactor/templatef2 branch makes modifications so that inventory_hostname != hostname. Note prom scrapes are still broken/not fixed for this.

@sjpb
Copy link
Collaborator Author

sjpb commented Dec 1, 2022

Superseded by #240 which uses inventory_hostname and inventory_hostname.clustername.tld to keep inventory_hostnames as resolvable names.

@sjpb sjpb closed this Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant