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

Format terraform related code according to terraform's convention #100

Merged
merged 4 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/terraform-apply.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,24 @@ on:
- .github/workflows/terraform-apply.yaml

jobs:
lint:
name: Linters
runs-on: ubuntu-22.04
steps:
- name: Checkout branch
uses: actions/checkout@v4

- name: Install Terraform
run: sudo snap install terraform --classic

- name: Terraform format lint
working-directory: ./terraform-plans
run: terraform fmt -check -recursive -diff

terraform:
name: Run Terraform
needs:
- lint
runs-on: ubuntu-22.04
strategy:
fail-fast: false
Expand Down
2 changes: 1 addition & 1 deletion terraform-plans/configs/bootstack-actions_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ templates = {
gitignore = {
source = "./templates/github/gitignore.tftpl"
destination = ".gitignore"
vars = {}
vars = {}
}
codeowners = {
source = "./templates/github/CODEOWNERS.tftpl"
Expand Down
8 changes: 4 additions & 4 deletions terraform-plans/configs/charm-advanced-routing_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ templates = {
gitignore = {
source = "./templates/github/gitignore.tftpl"
destination = ".gitignore"
vars = {}
vars = {}
}
codeowners = {
source = "./templates/github/CODEOWNERS.tftpl"
Expand All @@ -15,8 +15,8 @@ templates = {
check = {
source = "./templates/github/charm_check.yaml.tftpl"
destination = ".github/workflows/check.yaml"
vars = {
runs_on = "[[ubuntu-22.04]]",
vars = {
runs_on = "[[ubuntu-22.04]]",
test_commands = "['tox -e func']",
}
}
Expand All @@ -28,7 +28,7 @@ templates = {
release = {
source = "./templates/github/charm_release.yaml.tftpl"
destination = ".github/workflows/release.yaml"
vars = {
vars = {
runs_on = "[[ubuntu-22.04]]",
}
}
Expand Down
8 changes: 4 additions & 4 deletions terraform-plans/configs/charm-apt-mirror_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ templates = {
gitignore = {
source = "./templates/github/gitignore.tftpl"
destination = ".gitignore"
vars = {}
vars = {}
}
codeowners = {
source = "./templates/github/CODEOWNERS.tftpl"
Expand All @@ -15,8 +15,8 @@ templates = {
check = {
source = "./templates/github/charm_check.yaml.tftpl"
destination = ".github/workflows/check.yaml"
vars = {
runs_on = "[[ubuntu-22.04]]",
vars = {
runs_on = "[[ubuntu-22.04]]",
test_commands = "['tox -e func -- -v --series focal', 'tox -e func -- -v --series jammy']",
}
}
Expand All @@ -28,7 +28,7 @@ templates = {
release = {
source = "./templates/github/charm_release.yaml.tftpl"
destination = ".github/workflows/release.yaml"
vars = {
vars = {
runs_on = "[[ubuntu-22.04]]",
}
}
Expand Down
2 changes: 1 addition & 1 deletion terraform-plans/configs/charm-cloudsupport_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ templates = {
gitignore = {
source = "./templates/github/gitignore.tftpl"
destination = ".gitignore"
vars = {}
vars = {}
}
codeowners = {
source = "./templates/github/CODEOWNERS.tftpl"
Expand Down
2 changes: 1 addition & 1 deletion terraform-plans/configs/charm-duplicity_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ templates = {
gitignore = {
source = "./templates/github/gitignore.tftpl"
destination = ".gitignore"
vars = {}
vars = {}
}
codeowners = {
source = "./templates/github/CODEOWNERS.tftpl"
Expand Down
8 changes: 4 additions & 4 deletions terraform-plans/configs/charm-juju-backup-all_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ templates = {
gitignore = {
source = "./templates/github/gitignore.tftpl"
destination = ".gitignore"
vars = {}
vars = {}
}
codeowners = {
source = "./templates/github/CODEOWNERS.tftpl"
Expand All @@ -15,8 +15,8 @@ templates = {
check = {
source = "./templates/github/charm_check.yaml.tftpl"
destination = ".github/workflows/check.yaml"
vars = {
runs_on = "[[self-hosted, linux, x64, large, jammy]]",
vars = {
runs_on = "[[self-hosted, linux, x64, large, jammy]]",
test_commands = "['tox -e func']",
}
}
Expand All @@ -28,7 +28,7 @@ templates = {
release = {
source = "./templates/github/charm_release.yaml.tftpl"
destination = ".github/workflows/release.yaml"
vars = {
vars = {
runs_on = "[[ubuntu-22.04]]",
}
}
Expand Down
8 changes: 4 additions & 4 deletions terraform-plans/configs/charm-juju-local_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ templates = {
gitignore = {
source = "./templates/github/gitignore.tftpl"
destination = ".gitignore"
vars = {}
vars = {}
}
codeowners = {
source = "./templates/github/CODEOWNERS.tftpl"
Expand All @@ -15,8 +15,8 @@ templates = {
check = {
source = "./templates/github/charm_check.yaml.tftpl"
destination = ".github/workflows/check.yaml"
vars = {
runs_on = "[[ubuntu-22.04]]",
vars = {
runs_on = "[[ubuntu-22.04]]",
test_commands = "['tox -e func']",
}
}
Expand All @@ -28,7 +28,7 @@ templates = {
release = {
source = "./templates/github/charm_release.yaml.tftpl"
destination = ".github/workflows/release.yaml"
vars = {
vars = {
runs_on = "[[ubuntu-22.04]]",
}
}
Expand Down
8 changes: 4 additions & 4 deletions terraform-plans/configs/charm-local-users_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ templates = {
gitignore = {
source = "./templates/github/gitignore.tftpl"
destination = ".gitignore"
vars = {}
vars = {}
}
codeowners = {
source = "./templates/github/CODEOWNERS.tftpl"
Expand All @@ -15,13 +15,13 @@ templates = {
check = {
source = "./templates/github/charm_check.yaml.tftpl"
destination = ".github/workflows/check.yaml"
vars = {
vars = {
# github hosted runners are amd64
# Ubuntu_ARM64_4C_16G_01 is the github-hosted arm64 runner we have access to.
# We prefer the github runners because they are smaller machines and save resources.
# If we have issues with it, we can switch to the larger and more numerous self-hosted options:
# - runs-on: [self-hosted, jammy, ARM64]
runs_on = "[[ubuntu-22.04], [Ubuntu_ARM64_4C_16G_01]]",
runs_on = "[[ubuntu-22.04], [Ubuntu_ARM64_4C_16G_01]]",
test_commands = "['tox -e func']",
}
}
Expand All @@ -33,7 +33,7 @@ templates = {
release = {
source = "./templates/github/charm_release.yaml.tftpl"
destination = ".github/workflows/release.yaml"
vars = {
vars = {
# github hosted runners are amd64
# Ubuntu_ARM64_4C_16G_01 is the github-hosted arm64 runner we have access to.
# We prefer the github runners because they are smaller machines and save resources.
Expand Down
8 changes: 4 additions & 4 deletions terraform-plans/configs/charm-logrotated_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ templates = {
gitignore = {
source = "./templates/github/gitignore.tftpl"
destination = ".gitignore"
vars = {}
vars = {}
}
codeowners = {
source = "./templates/github/CODEOWNERS.tftpl"
Expand All @@ -15,8 +15,8 @@ templates = {
check = {
source = "./templates/github/charm_check.yaml.tftpl"
destination = ".github/workflows/check.yaml"
vars = {
runs_on = "[[ubuntu-22.04]]",
vars = {
runs_on = "[[ubuntu-22.04]]",
test_commands = "['tox -e func']",
}
}
Expand All @@ -28,7 +28,7 @@ templates = {
release = {
source = "./templates/github/charm_release.yaml.tftpl"
destination = ".github/workflows/release.yaml"
vars = {
vars = {
runs_on = "[[ubuntu-22.04]]",
}
}
Expand Down
8 changes: 4 additions & 4 deletions terraform-plans/configs/charm-nginx_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ templates = {
gitignore = {
source = "./templates/github/gitignore.tftpl"
destination = ".gitignore"
vars = {}
vars = {}
}
codeowners = {
source = "./templates/github/CODEOWNERS.tftpl"
Expand All @@ -15,8 +15,8 @@ templates = {
check = {
source = "./templates/github/charm_check.yaml.tftpl"
destination = ".github/workflows/check.yaml"
vars = {
runs_on = "[[ubuntu-22.04]]",
vars = {
runs_on = "[[ubuntu-22.04]]",
test_commands = "['tox -e func']",
}
}
Expand All @@ -28,7 +28,7 @@ templates = {
release = {
source = "./templates/github/charm_release.yaml.tftpl"
destination = ".github/workflows/release.yaml"
vars = {
vars = {
runs_on = "[[ubuntu-22.04]]",
}
}
Expand Down
8 changes: 4 additions & 4 deletions terraform-plans/configs/charm-nrpe_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ templates = {
gitignore = {
source = "./templates/github/gitignore.tftpl"
destination = ".gitignore"
vars = {}
vars = {}
}
codeowners = {
source = "./templates/github/CODEOWNERS.tftpl"
Expand All @@ -15,13 +15,13 @@ templates = {
check = {
source = "./templates/github/charm_check.yaml.tftpl"
destination = ".github/workflows/check.yaml"
vars = {
vars = {
# github hosted runners are amd64
# Ubuntu_ARM64_4C_16G_01 is the github-hosted arm64 runner we have access to.
# We prefer the github runners because they are smaller machines and save resources.
# If we have issues with it, we can switch to the larger and more numerous self-hosted options:
# - runs-on: [self-hosted, jammy, ARM64]
runs_on = "[[ubuntu-22.04], [Ubuntu_ARM64_4C_16G_01]]",
runs_on = "[[ubuntu-22.04], [Ubuntu_ARM64_4C_16G_01]]",
test_commands = "['tox -e func']",
}
}
Expand All @@ -33,7 +33,7 @@ templates = {
release = {
source = "./templates/github/charm_release.yaml.tftpl"
destination = ".github/workflows/release.yaml"
vars = {
vars = {
runs_on = "[[ubuntu-22.04]]",
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ templates = {
gitignore = {
source = "./templates/github/gitignore.tftpl"
destination = ".gitignore"
vars = {}
vars = {}
}
codeowners = {
source = "./templates/github/CODEOWNERS.tftpl"
Expand All @@ -20,7 +20,7 @@ templates = {
release = {
source = "./templates/github/charm_release.yaml.tftpl"
destination = ".github/workflows/release.yaml"
vars = {
vars = {
runs_on = "[[ubuntu-22.04]]",
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ templates = {
gitignore = {
source = "./templates/github/gitignore.tftpl"
destination = ".gitignore"
vars = {}
vars = {}
}
codeowners = {
source = "./templates/github/CODEOWNERS.tftpl"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ templates = {
gitignore = {
source = "./templates/github/gitignore.tftpl"
destination = ".gitignore"
vars = {}
vars = {}
}
codeowners = {
source = "./templates/github/CODEOWNERS.tftpl"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ templates = {
gitignore = {
source = "./templates/github/gitignore.tftpl"
destination = ".gitignore"
vars = {}
vars = {}
}
codeowners = {
source = "./templates/github/CODEOWNERS.tftpl"
Expand All @@ -15,13 +15,13 @@ templates = {
check = {
source = "./templates/github/charm_check.yaml.tftpl"
destination = ".github/workflows/check.yaml"
vars = {
vars = {
# github hosted runners are amd64
# Ubuntu_ARM64_4C_16G_01 is the github-hosted arm64 runner we have access to.
# We prefer the github runners because they are smaller machines and save resources.
# If we have issues with it, we can switch to the larger and more numerous self-hosted options:
# - runs-on: [self-hosted, jammy, ARM64]
runs_on = "[[ubuntu-22.04], [Ubuntu_ARM64_4C_16G_01]]",
runs_on = "[[ubuntu-22.04], [Ubuntu_ARM64_4C_16G_01]]",
test_commands = "['tox -e func']",
}
}
Expand All @@ -33,7 +33,7 @@ templates = {
release = {
source = "./templates/github/charm_release.yaml.tftpl"
destination = ".github/workflows/release.yaml"
vars = {
vars = {
# github hosted runners are amd64
# Ubuntu_ARM64_4C_16G_01 is the github-hosted arm64 runner we have access to.
# We prefer the github runners because they are smaller machines and save resources.
Expand Down
2 changes: 1 addition & 1 deletion terraform-plans/configs/charm-simple-streams_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ templates = {
gitignore = {
source = "./templates/github/gitignore.tftpl"
destination = ".gitignore"
vars = {}
vars = {}
}
codeowners = {
source = "./templates/github/CODEOWNERS.tftpl"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ templates = {
gitignore = {
source = "./templates/github/gitignore.tftpl"
destination = ".gitignore"
vars = {}
vars = {}
}
codeowners = {
source = "./templates/github/CODEOWNERS.tftpl"
Expand Down
Loading