Terraform module to generate RKE2 config files
Go to file
github-actions[bot] ea32d85678
chore(main): release 1.0.0 (#33)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-03-10 08:38:00 -05:00
.github fix!: remove unnecessary tests (#34) 2025-03-10 08:35:12 -05:00
examples fix: update to comply with new restrictions (#32) 2025-03-06 16:12:01 -06:00
test/tests fix: update to comply with new restrictions (#32) 2025-03-06 16:12:01 -06:00
.aliases fix: update to comply with new restrictions (#32) 2025-03-06 16:12:01 -06:00
.envrc fix: update to comply with new restrictions (#32) 2025-03-06 16:12:01 -06:00
.functions fix: update to comply with new restrictions (#32) 2025-03-06 16:12:01 -06:00
.gitignore fix: use file name without path in object index, upgrade workflows (#21) 2023-11-28 14:56:04 -06:00
.gitleaksignore fix: update workflows and flake (#23) 2024-02-07 15:12:28 -06:00
.rcs fix: update to comply with new restrictions (#32) 2025-03-06 16:12:01 -06:00
.variables fix: update to comply with new restrictions (#32) 2025-03-06 16:12:01 -06:00
CHANGELOG.md chore(main): release 1.0.0 (#33) 2025-03-10 08:38:00 -05:00
LICENSE initial 2023-07-10 13:58:15 -05:00
README.md fix: use file name without path in object index, upgrade workflows (#21) 2023-11-28 14:56:04 -06:00
flake.lock fix: update to comply with new restrictions (#32) 2025-03-06 16:12:01 -06:00
flake.nix fix: update to comply with new restrictions (#32) 2025-03-06 16:12:01 -06:00
helptojson.sh fix: update to comply with new restrictions (#32) 2025-03-06 16:12:01 -06:00
main.tf fix: use file name without path in object index, upgrade workflows (#21) 2023-11-28 14:56:04 -06:00
outputs.tf fix: use file name without path in object index, upgrade workflows (#21) 2023-11-28 14:56:04 -06:00
run_tests.sh fix!: remove unnecessary tests (#34) 2025-03-10 08:35:12 -05:00
terraform.md fix: use file name without path in object index, upgrade workflows (#21) 2023-11-28 14:56:04 -06:00
variables.md initial (#4) 2023-07-21 15:41:37 -05:00
variables.tf fix: ipv6 server regex allows port (#27) 2024-08-15 09:50:12 -05:00
versions.tf fix: remove version constraints (#31) 2025-03-03 17:44:57 -06:00

README.md

Terraform Local RKE2 Config

This module uses the yamlencode and jsonencode Terraform functions to provide config contents from the variables supplied. There are two different outputs on this module, yaml and json. Either may be used to configure rke2. This is an "Independent" module, please see terraform.md for more information.

Examples

Local State

The specific use case for the example modules is temporary infrastructure for testing purposes. With that in mind, it is not expected that we manage the resources as a team, therefore the state files are all stored locally. If you would like to store the state files remotely, add a terraform backend file (*.name.tfbackend) to your implementation module. https://www.terraform.io/language/settings/backends/configuration#file

Development and Testing

Paradigms and Expectations

Please make sure to read terraform.md to understand the paradigms and expectations that this module has for development.

Environment

It is important to us that all collaborators have the ability to develop in similar environments, so we use tools which enable this as much as possible. These tools are not necessary, but they can make it much simpler to collaborate.

  • I use nix that I have installed using their recommended script
  • I use direnv that I have installed using brew.
  • I simply use direnv allow to enter the environment
  • I navigate to the tests directory and run go test -v -timeout=5m -parallel=10
  • To run an individual test I nvaigate to the tests directory and run go test -v -timeout=5m -run <test function name>
    • eg. go test -v -timeout=5m -run TestBasic
  • I use override.tf files to change the values of examples to personalized data so that I can run them

Our continuous integration tests in the GitHub ubuntu-latest runner, which has many different things installed.

RKE2 Binary

When developing, we build variables.tf based on the help command on the RKE2 binary. This is a big topic, please see variables.md for more information.

Override Tests

You may want to test this code with slightly different parameters for your environment. Check out Terraform override files as a clean way to modify the inputs without accidentally committing any personalized code.