Skip to content

Commit

Permalink
Format terraform related code according to terraform's convention (#100)
Browse files Browse the repository at this point in the history
Co-authored-by: Samuel Allan <[email protected]>
  • Loading branch information
chanchiwai-ray and samuelallan72 authored Oct 8, 2024
1 parent 19c4706 commit 7b51e2a
Show file tree
Hide file tree
Showing 50 changed files with 135 additions and 119 deletions.
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

0 comments on commit 7b51e2a

Please sign in to comment.