From f82d895b7ed33025e8a5db1f244265fabc857ebc Mon Sep 17 00:00:00 2001 From: Chi Wai Chan Date: Tue, 8 Oct 2024 10:58:42 +0800 Subject: [PATCH 1/3] Run `terraform fmt` --- .../configs/bootstack-actions_main.tfvars | 2 +- .../configs/charm-advanced-routing_main.tfvars | 8 ++++---- .../configs/charm-apt-mirror_main.tfvars | 8 ++++---- .../configs/charm-cloudsupport_main.tfvars | 2 +- .../configs/charm-duplicity_main.tfvars | 2 +- .../configs/charm-juju-backup-all_main.tfvars | 8 ++++---- .../configs/charm-juju-local_main.tfvars | 8 ++++---- .../configs/charm-local-users_main.tfvars | 8 ++++---- .../configs/charm-logrotated_main.tfvars | 8 ++++---- .../configs/charm-nginx_main.tfvars | 8 ++++---- terraform-plans/configs/charm-nrpe_main.tfvars | 8 ++++---- .../charm-openstack-service-checks_main.tfvars | 4 ++-- ...rm-prometheus-blackbox-exporter_main.tfvars | 2 +- .../charm-prometheus-juju-exporter_main.tfvars | 2 +- ...arm-prometheus-libvirt-exporter_main.tfvars | 8 ++++---- .../configs/charm-simple-streams_main.tfvars | 2 +- .../charm-storage-connector_main.tfvars | 2 +- .../configs/charm-sysconfig_main.tfvars | 8 ++++---- .../configs/charm-userdir-ldap_main.tfvars | 8 ++++---- ...charmed-openstack-exporter-snap_main.tfvars | 6 +++--- .../charmed-openstack-upgrader_main.tfvars | 4 ++-- terraform-plans/configs/dcgm-snap_main.tfvars | 12 ++++++------ .../hardware-observer-operator_main.tfvars | 8 ++++---- .../configs/juju-backup-all_main.tfvars | 2 +- terraform-plans/configs/juju-lint_main.tfvars | 2 +- .../configs/layer-beats-base_main.tfvars | 2 +- .../configs/layer-filebeat_main.tfvars | 2 +- .../openstack-exporter-operator_main.tfvars | 4 ++-- .../prometheus-hardware-exporter_main.tfvars | 2 +- ...etheus-juju-backup-all-exporter_main.tfvars | 2 +- .../prometheus-juju-exporter_main.tfvars | 2 +- .../prometheus-openstack-exporter_main.tfvars | 2 +- .../configs/smartctl-exporter-snap_main.tfvars | 10 +++++----- .../snap-tempest-automation_main.tfvars | 2 +- .../configs/snap-tempest_main.tfvars | 2 +- .../snap-tempest_stable_antelope.tfvars | 2 +- .../configs/snap-tempest_stable_bobcat.tfvars | 2 +- .../configs/snap-tempest_stable_caracal.tfvars | 2 +- .../configs/snap-tempest_stable_ussuri.tfvars | 2 +- .../snap-tempest_stable_victoria.tfvars | 2 +- .../configs/snap-tempest_stable_wallaby.tfvars | 2 +- .../configs/snap-tempest_stable_xena.tfvars | 2 +- .../configs/snap-tempest_stable_yoga.tfvars | 2 +- .../configs/snap-tempest_stable_zed.tfvars | 2 +- .../configs/tailscale-snap_main.tfvars | 10 +++++----- terraform-plans/main.tf | 10 +++++----- .../modules/GitHub/templates/main.tf | 18 +++++++++--------- .../modules/GitHub/templates/variables.tf | 4 ++-- terraform-plans/variables.tf | 4 ++-- 49 files changed, 117 insertions(+), 117 deletions(-) diff --git a/terraform-plans/configs/bootstack-actions_main.tfvars b/terraform-plans/configs/bootstack-actions_main.tfvars index 80c186d..adce780 100644 --- a/terraform-plans/configs/bootstack-actions_main.tfvars +++ b/terraform-plans/configs/bootstack-actions_main.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" diff --git a/terraform-plans/configs/charm-advanced-routing_main.tfvars b/terraform-plans/configs/charm-advanced-routing_main.tfvars index 32d5804..bb711f3 100644 --- a/terraform-plans/configs/charm-advanced-routing_main.tfvars +++ b/terraform-plans/configs/charm-advanced-routing_main.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" @@ -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']", } } @@ -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]]", } } diff --git a/terraform-plans/configs/charm-apt-mirror_main.tfvars b/terraform-plans/configs/charm-apt-mirror_main.tfvars index 7f7549b..350482a 100644 --- a/terraform-plans/configs/charm-apt-mirror_main.tfvars +++ b/terraform-plans/configs/charm-apt-mirror_main.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" @@ -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']", } } @@ -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]]", } } diff --git a/terraform-plans/configs/charm-cloudsupport_main.tfvars b/terraform-plans/configs/charm-cloudsupport_main.tfvars index bce34dd..9ad1f70 100644 --- a/terraform-plans/configs/charm-cloudsupport_main.tfvars +++ b/terraform-plans/configs/charm-cloudsupport_main.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" diff --git a/terraform-plans/configs/charm-duplicity_main.tfvars b/terraform-plans/configs/charm-duplicity_main.tfvars index f0e1558..83040af 100644 --- a/terraform-plans/configs/charm-duplicity_main.tfvars +++ b/terraform-plans/configs/charm-duplicity_main.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" diff --git a/terraform-plans/configs/charm-juju-backup-all_main.tfvars b/terraform-plans/configs/charm-juju-backup-all_main.tfvars index 8f5c631..b3a4dd2 100644 --- a/terraform-plans/configs/charm-juju-backup-all_main.tfvars +++ b/terraform-plans/configs/charm-juju-backup-all_main.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" @@ -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']", } } @@ -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]]", } } diff --git a/terraform-plans/configs/charm-juju-local_main.tfvars b/terraform-plans/configs/charm-juju-local_main.tfvars index c8bfeb9..79b8d09 100644 --- a/terraform-plans/configs/charm-juju-local_main.tfvars +++ b/terraform-plans/configs/charm-juju-local_main.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" @@ -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']", } } @@ -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]]", } } diff --git a/terraform-plans/configs/charm-local-users_main.tfvars b/terraform-plans/configs/charm-local-users_main.tfvars index 16d919b..9182acd 100644 --- a/terraform-plans/configs/charm-local-users_main.tfvars +++ b/terraform-plans/configs/charm-local-users_main.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" @@ -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']", } } @@ -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. diff --git a/terraform-plans/configs/charm-logrotated_main.tfvars b/terraform-plans/configs/charm-logrotated_main.tfvars index 9104592..a821ecd 100644 --- a/terraform-plans/configs/charm-logrotated_main.tfvars +++ b/terraform-plans/configs/charm-logrotated_main.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" @@ -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']", } } @@ -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]]", } } diff --git a/terraform-plans/configs/charm-nginx_main.tfvars b/terraform-plans/configs/charm-nginx_main.tfvars index c422f13..6f28755 100644 --- a/terraform-plans/configs/charm-nginx_main.tfvars +++ b/terraform-plans/configs/charm-nginx_main.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" @@ -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']", } } @@ -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]]", } } diff --git a/terraform-plans/configs/charm-nrpe_main.tfvars b/terraform-plans/configs/charm-nrpe_main.tfvars index 9f24682..e002730 100644 --- a/terraform-plans/configs/charm-nrpe_main.tfvars +++ b/terraform-plans/configs/charm-nrpe_main.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" @@ -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']", } } @@ -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]]", } } diff --git a/terraform-plans/configs/charm-openstack-service-checks_main.tfvars b/terraform-plans/configs/charm-openstack-service-checks_main.tfvars index e932b5d..b7d7760 100644 --- a/terraform-plans/configs/charm-openstack-service-checks_main.tfvars +++ b/terraform-plans/configs/charm-openstack-service-checks_main.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" @@ -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]]", } } diff --git a/terraform-plans/configs/charm-prometheus-blackbox-exporter_main.tfvars b/terraform-plans/configs/charm-prometheus-blackbox-exporter_main.tfvars index 72eb5cd..299d875 100644 --- a/terraform-plans/configs/charm-prometheus-blackbox-exporter_main.tfvars +++ b/terraform-plans/configs/charm-prometheus-blackbox-exporter_main.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" diff --git a/terraform-plans/configs/charm-prometheus-juju-exporter_main.tfvars b/terraform-plans/configs/charm-prometheus-juju-exporter_main.tfvars index 908f479..4bdfda3 100644 --- a/terraform-plans/configs/charm-prometheus-juju-exporter_main.tfvars +++ b/terraform-plans/configs/charm-prometheus-juju-exporter_main.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" diff --git a/terraform-plans/configs/charm-prometheus-libvirt-exporter_main.tfvars b/terraform-plans/configs/charm-prometheus-libvirt-exporter_main.tfvars index 06e45ac..f76f891 100644 --- a/terraform-plans/configs/charm-prometheus-libvirt-exporter_main.tfvars +++ b/terraform-plans/configs/charm-prometheus-libvirt-exporter_main.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" @@ -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']", } } @@ -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. diff --git a/terraform-plans/configs/charm-simple-streams_main.tfvars b/terraform-plans/configs/charm-simple-streams_main.tfvars index f80102a..3d44c43 100644 --- a/terraform-plans/configs/charm-simple-streams_main.tfvars +++ b/terraform-plans/configs/charm-simple-streams_main.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" diff --git a/terraform-plans/configs/charm-storage-connector_main.tfvars b/terraform-plans/configs/charm-storage-connector_main.tfvars index 9f0dbd9..6e3fefe 100644 --- a/terraform-plans/configs/charm-storage-connector_main.tfvars +++ b/terraform-plans/configs/charm-storage-connector_main.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" diff --git a/terraform-plans/configs/charm-sysconfig_main.tfvars b/terraform-plans/configs/charm-sysconfig_main.tfvars index 4b5ce8c..2f75160 100644 --- a/terraform-plans/configs/charm-sysconfig_main.tfvars +++ b/terraform-plans/configs/charm-sysconfig_main.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" @@ -15,10 +15,10 @@ templates = { check = { source = "./templates/github/charm_check.yaml.tftpl" destination = ".github/workflows/check.yaml" - vars = { + vars = { # Skip ARM64 check because the functional test runs on lxd VM which is not working # on arm64 right now. - runs_on = "[[self-hosted, jammy, X64, large]]", + runs_on = "[[self-hosted, jammy, X64, large]]", test_commands = "['tox -e func']", } } @@ -30,7 +30,7 @@ templates = { release = { source = "./templates/github/charm_release.yaml.tftpl" destination = ".github/workflows/release.yaml" - vars = { + vars = { runs_on = "[[ubuntu-22.04], [Ubuntu_ARM64_4C_16G_01]]", } } diff --git a/terraform-plans/configs/charm-userdir-ldap_main.tfvars b/terraform-plans/configs/charm-userdir-ldap_main.tfvars index c55c5bc..adbfb60 100644 --- a/terraform-plans/configs/charm-userdir-ldap_main.tfvars +++ b/terraform-plans/configs/charm-userdir-ldap_main.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" @@ -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']", } } @@ -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]]", } } diff --git a/terraform-plans/configs/charmed-openstack-exporter-snap_main.tfvars b/terraform-plans/configs/charmed-openstack-exporter-snap_main.tfvars index ffd5735..cbbf2bd 100644 --- a/terraform-plans/configs/charmed-openstack-exporter-snap_main.tfvars +++ b/terraform-plans/configs/charmed-openstack-exporter-snap_main.tfvars @@ -5,16 +5,16 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" destination = ".github/CODEOWNERS" - vars = {} + vars = {} } promote = { source = "./templates/github/snap_promote.yaml.tftpl" destination = ".github/workflows/promote.yaml" - vars = {} + vars = {} } } diff --git a/terraform-plans/configs/charmed-openstack-upgrader_main.tfvars b/terraform-plans/configs/charmed-openstack-upgrader_main.tfvars index c2cb8fd..07fd67b 100644 --- a/terraform-plans/configs/charmed-openstack-upgrader_main.tfvars +++ b/terraform-plans/configs/charmed-openstack-upgrader_main.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" @@ -20,7 +20,7 @@ templates = { release = { source = "./templates/github/snap_release.yaml.tftpl" destination = ".github/workflows/release.yaml" - vars = { + vars = { runs_on = "[[ubuntu-22.04]]", } } diff --git a/terraform-plans/configs/dcgm-snap_main.tfvars b/terraform-plans/configs/dcgm-snap_main.tfvars index 7dc62b3..e0be85f 100644 --- a/terraform-plans/configs/dcgm-snap_main.tfvars +++ b/terraform-plans/configs/dcgm-snap_main.tfvars @@ -5,30 +5,30 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" destination = ".github/CODEOWNERS" - vars = {} + vars = {} } check = { source = "./templates/github/snap_check.yaml.tftpl" destination = ".github/workflows/check.yaml" - vars = { + vars = { runs_on = "[[ubuntu-22.04], [self-hosted, jammy, ARM64]]", } } promote = { source = "./templates/github/snap_promote.yaml.tftpl" destination = ".github/workflows/promote.yaml" - vars = {} + vars = {} } release = { source = "./templates/github/snap_release.yaml.tftpl" destination = ".github/workflows/release.yaml" - vars = { - runs_on = "[[ubuntu-22.04], [self-hosted, jammy, ARM64]]", + vars = { + runs_on = "[[ubuntu-22.04], [self-hosted, jammy, ARM64]]", } } yamllint = { diff --git a/terraform-plans/configs/hardware-observer-operator_main.tfvars b/terraform-plans/configs/hardware-observer-operator_main.tfvars index 0895ba4..c566821 100644 --- a/terraform-plans/configs/hardware-observer-operator_main.tfvars +++ b/terraform-plans/configs/hardware-observer-operator_main.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" @@ -15,8 +15,8 @@ templates = { check = { source = "./templates/github/charm_check.yaml.tftpl" destination = ".github/workflows/check.yaml" - vars = { - runs_on = "[[ubuntu-22.04], [Ubuntu_ARM64_4C_16G_01]]", + vars = { + runs_on = "[[ubuntu-22.04], [Ubuntu_ARM64_4C_16G_01]]", test_commands = "['tox -e func -- -v --series focal --keep-models', 'tox -e func -- -v --series jammy --keep-models']", } } @@ -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], [Ubuntu_ARM64_4C_16G_01]]", } } diff --git a/terraform-plans/configs/juju-backup-all_main.tfvars b/terraform-plans/configs/juju-backup-all_main.tfvars index 79f639a..72fb893 100644 --- a/terraform-plans/configs/juju-backup-all_main.tfvars +++ b/terraform-plans/configs/juju-backup-all_main.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" diff --git a/terraform-plans/configs/juju-lint_main.tfvars b/terraform-plans/configs/juju-lint_main.tfvars index 79dcad4..85efdee 100644 --- a/terraform-plans/configs/juju-lint_main.tfvars +++ b/terraform-plans/configs/juju-lint_main.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" diff --git a/terraform-plans/configs/layer-beats-base_main.tfvars b/terraform-plans/configs/layer-beats-base_main.tfvars index 22710ac..fec2389 100644 --- a/terraform-plans/configs/layer-beats-base_main.tfvars +++ b/terraform-plans/configs/layer-beats-base_main.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" diff --git a/terraform-plans/configs/layer-filebeat_main.tfvars b/terraform-plans/configs/layer-filebeat_main.tfvars index 50d1be5..cbd6dbe 100644 --- a/terraform-plans/configs/layer-filebeat_main.tfvars +++ b/terraform-plans/configs/layer-filebeat_main.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" diff --git a/terraform-plans/configs/openstack-exporter-operator_main.tfvars b/terraform-plans/configs/openstack-exporter-operator_main.tfvars index b54e109..22f41d9 100644 --- a/terraform-plans/configs/openstack-exporter-operator_main.tfvars +++ b/terraform-plans/configs/openstack-exporter-operator_main.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" @@ -21,7 +21,7 @@ templates = { release = { source = "./templates/github/charm_release.yaml.tftpl" destination = ".github/workflows/release.yaml" - vars = { + vars = { runs_on = "[[ubuntu-22.04]]", } } diff --git a/terraform-plans/configs/prometheus-hardware-exporter_main.tfvars b/terraform-plans/configs/prometheus-hardware-exporter_main.tfvars index fe661f0..b42706a 100644 --- a/terraform-plans/configs/prometheus-hardware-exporter_main.tfvars +++ b/terraform-plans/configs/prometheus-hardware-exporter_main.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" diff --git a/terraform-plans/configs/prometheus-juju-backup-all-exporter_main.tfvars b/terraform-plans/configs/prometheus-juju-backup-all-exporter_main.tfvars index b111a49..ae8fcd1 100644 --- a/terraform-plans/configs/prometheus-juju-backup-all-exporter_main.tfvars +++ b/terraform-plans/configs/prometheus-juju-backup-all-exporter_main.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" diff --git a/terraform-plans/configs/prometheus-juju-exporter_main.tfvars b/terraform-plans/configs/prometheus-juju-exporter_main.tfvars index 92a30fd..fee25d9 100644 --- a/terraform-plans/configs/prometheus-juju-exporter_main.tfvars +++ b/terraform-plans/configs/prometheus-juju-exporter_main.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" diff --git a/terraform-plans/configs/prometheus-openstack-exporter_main.tfvars b/terraform-plans/configs/prometheus-openstack-exporter_main.tfvars index c639f74..68e5271 100644 --- a/terraform-plans/configs/prometheus-openstack-exporter_main.tfvars +++ b/terraform-plans/configs/prometheus-openstack-exporter_main.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" diff --git a/terraform-plans/configs/smartctl-exporter-snap_main.tfvars b/terraform-plans/configs/smartctl-exporter-snap_main.tfvars index aa8ed4a..7c8585e 100644 --- a/terraform-plans/configs/smartctl-exporter-snap_main.tfvars +++ b/terraform-plans/configs/smartctl-exporter-snap_main.tfvars @@ -5,29 +5,29 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" destination = ".github/CODEOWNERS" - vars = {} + vars = {} } check = { source = "./templates/github/snap_check.yaml.tftpl" destination = ".github/workflows/check.yaml" - vars = { + vars = { runs_on = "[[ubuntu-22.04], [self-hosted, jammy, ARM64]]", } } promote = { source = "./templates/github/snap_promote.yaml.tftpl" destination = ".github/workflows/promote.yaml" - vars = {} + vars = {} } release = { source = "./templates/github/snap_release.yaml.tftpl" destination = ".github/workflows/release.yaml" - vars = { + vars = { runs_on = "[[ubuntu-22.04], [self-hosted, jammy, ARM64]]", } } diff --git a/terraform-plans/configs/snap-tempest-automation_main.tfvars b/terraform-plans/configs/snap-tempest-automation_main.tfvars index 08105ac..0353126 100644 --- a/terraform-plans/configs/snap-tempest-automation_main.tfvars +++ b/terraform-plans/configs/snap-tempest-automation_main.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" diff --git a/terraform-plans/configs/snap-tempest_main.tfvars b/terraform-plans/configs/snap-tempest_main.tfvars index 01323be..bd4c141 100644 --- a/terraform-plans/configs/snap-tempest_main.tfvars +++ b/terraform-plans/configs/snap-tempest_main.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" diff --git a/terraform-plans/configs/snap-tempest_stable_antelope.tfvars b/terraform-plans/configs/snap-tempest_stable_antelope.tfvars index b26413f..c3bfa3c 100644 --- a/terraform-plans/configs/snap-tempest_stable_antelope.tfvars +++ b/terraform-plans/configs/snap-tempest_stable_antelope.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" diff --git a/terraform-plans/configs/snap-tempest_stable_bobcat.tfvars b/terraform-plans/configs/snap-tempest_stable_bobcat.tfvars index 7794e82..d7a8dfa 100644 --- a/terraform-plans/configs/snap-tempest_stable_bobcat.tfvars +++ b/terraform-plans/configs/snap-tempest_stable_bobcat.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" diff --git a/terraform-plans/configs/snap-tempest_stable_caracal.tfvars b/terraform-plans/configs/snap-tempest_stable_caracal.tfvars index ed9ccb4..5d51f97 100644 --- a/terraform-plans/configs/snap-tempest_stable_caracal.tfvars +++ b/terraform-plans/configs/snap-tempest_stable_caracal.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" diff --git a/terraform-plans/configs/snap-tempest_stable_ussuri.tfvars b/terraform-plans/configs/snap-tempest_stable_ussuri.tfvars index 3e05fa6..c0895aa 100644 --- a/terraform-plans/configs/snap-tempest_stable_ussuri.tfvars +++ b/terraform-plans/configs/snap-tempest_stable_ussuri.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" diff --git a/terraform-plans/configs/snap-tempest_stable_victoria.tfvars b/terraform-plans/configs/snap-tempest_stable_victoria.tfvars index c8cf241..513a583 100644 --- a/terraform-plans/configs/snap-tempest_stable_victoria.tfvars +++ b/terraform-plans/configs/snap-tempest_stable_victoria.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" diff --git a/terraform-plans/configs/snap-tempest_stable_wallaby.tfvars b/terraform-plans/configs/snap-tempest_stable_wallaby.tfvars index dce2986..e2b8e62 100644 --- a/terraform-plans/configs/snap-tempest_stable_wallaby.tfvars +++ b/terraform-plans/configs/snap-tempest_stable_wallaby.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" diff --git a/terraform-plans/configs/snap-tempest_stable_xena.tfvars b/terraform-plans/configs/snap-tempest_stable_xena.tfvars index 521f718..ceb3dd0 100644 --- a/terraform-plans/configs/snap-tempest_stable_xena.tfvars +++ b/terraform-plans/configs/snap-tempest_stable_xena.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" diff --git a/terraform-plans/configs/snap-tempest_stable_yoga.tfvars b/terraform-plans/configs/snap-tempest_stable_yoga.tfvars index 604c93a..5d3d294 100644 --- a/terraform-plans/configs/snap-tempest_stable_yoga.tfvars +++ b/terraform-plans/configs/snap-tempest_stable_yoga.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" diff --git a/terraform-plans/configs/snap-tempest_stable_zed.tfvars b/terraform-plans/configs/snap-tempest_stable_zed.tfvars index 2325c66..d6fa33f 100644 --- a/terraform-plans/configs/snap-tempest_stable_zed.tfvars +++ b/terraform-plans/configs/snap-tempest_stable_zed.tfvars @@ -5,7 +5,7 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" diff --git a/terraform-plans/configs/tailscale-snap_main.tfvars b/terraform-plans/configs/tailscale-snap_main.tfvars index 05328cd..f248b9c 100644 --- a/terraform-plans/configs/tailscale-snap_main.tfvars +++ b/terraform-plans/configs/tailscale-snap_main.tfvars @@ -5,29 +5,29 @@ templates = { gitignore = { source = "./templates/github/gitignore.tftpl" destination = ".gitignore" - vars = {} + vars = {} } codeowners = { source = "./templates/github/CODEOWNERS.tftpl" destination = ".github/CODEOWNERS" - vars = {} + vars = {} } check = { source = "./templates/github/snap_check.yaml.tftpl" destination = ".github/workflows/check.yaml" - vars = { + vars = { runs_on = "[[ubuntu-22.04]]", } } promote = { source = "./templates/github/snap_promote.yaml.tftpl" destination = ".github/workflows/promote.yaml" - vars = {} + vars = {} } release = { source = "./templates/github/snap_release.yaml.tftpl" destination = ".github/workflows/release.yaml" - vars = { + vars = { runs_on = "[[ubuntu-22.04]]", } } diff --git a/terraform-plans/main.tf b/terraform-plans/main.tf index de8e820..ec56d43 100644 --- a/terraform-plans/main.tf +++ b/terraform-plans/main.tf @@ -7,11 +7,11 @@ module "github_settings" { } module "github_templates" { - source = "./modules/GitHub/templates" - owner = var.owner - repository = var.repository - branch = var.branch - templates = var.templates + source = "./modules/GitHub/templates" + owner = var.owner + repository = var.repository + branch = var.branch + templates = var.templates } output "repository" { diff --git a/terraform-plans/modules/GitHub/templates/main.tf b/terraform-plans/modules/GitHub/templates/main.tf index a1c5e1e..f35b09b 100644 --- a/terraform-plans/modules/GitHub/templates/main.tf +++ b/terraform-plans/modules/GitHub/templates/main.tf @@ -83,15 +83,15 @@ data "github_repository_pull_requests" "open" { } locals { - pr_exists = length([for pr in data.github_repository_pull_requests.open.results : pr if pr.head_ref == local.pr_branch]) > 0 + pr_exists = length([for pr in data.github_repository_pull_requests.open.results : pr if pr.head_ref == local.pr_branch]) > 0 } locals { - existing_pr = local.pr_exists ? [for pr in data.github_repository_pull_requests.open.results : pr if pr.head_ref == local.pr_branch][0] : null + existing_pr = local.pr_exists ? [for pr in data.github_repository_pull_requests.open.results : pr if pr.head_ref == local.pr_branch][0] : null } locals { - should_create_pr = length(local.changed_files) > 0 && !local.pr_exists + should_create_pr = length(local.changed_files) > 0 && !local.pr_exists } # Create a pull request only if there are changed files and there isn't already a PR open for the branch @@ -135,12 +135,12 @@ output "pr_branch" { output "pr_url" { value = ( length(local.changed_files) > 0 ? - ( - local.should_create_pr ? - "https://github.com/${var.owner}/${var.repository}/pull/${github_repository_pull_request.managed_files_update_pr[0].number}" : - "https://github.com/${var.owner}/${var.repository}/pull/${local.existing_pr.number}" - ) : - "No PR created" + ( + local.should_create_pr ? + "https://github.com/${var.owner}/${var.repository}/pull/${github_repository_pull_request.managed_files_update_pr[0].number}" : + "https://github.com/${var.owner}/${var.repository}/pull/${local.existing_pr.number}" + ) : + "No PR created" ) depends_on = [ diff --git a/terraform-plans/modules/GitHub/templates/variables.tf b/terraform-plans/modules/GitHub/templates/variables.tf index 6545f8e..c2f6f85 100644 --- a/terraform-plans/modules/GitHub/templates/variables.tf +++ b/terraform-plans/modules/GitHub/templates/variables.tf @@ -35,12 +35,12 @@ variable "pr_body" { variable "templates" { type = map(object({ # Path to the template file in this repository. - source = string + source = string # Path to the target file in the target repository. destination = string # Variables used in the template, # expected to be variables as passed as the second argument to `templatefile()`. - vars = any + vars = any })) description = "Files to be templated into the target GitHub repository." } diff --git a/terraform-plans/variables.tf b/terraform-plans/variables.tf index 48aecc4..363747e 100644 --- a/terraform-plans/variables.tf +++ b/terraform-plans/variables.tf @@ -22,12 +22,12 @@ variable "branch" { variable "templates" { type = map(object({ # Path to the template file in this repository. - source = string + source = string # Path to the target file in the target repository. destination = string # Variables used in the template, # expected to be variables as passed as the second argument to `templatefile()`. - vars = any + vars = any })) description = "Files to be templated into the target GitHub repository." } From 9bb587bc7c1d41d518c7ebd14348306a0f101d07 Mon Sep 17 00:00:00 2001 From: Chi Wai Chan Date: Tue, 8 Oct 2024 11:04:37 +0800 Subject: [PATCH 2/3] Add terraform format linter in CI --- .github/workflows/terraform-apply.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/terraform-apply.yaml b/.github/workflows/terraform-apply.yaml index c768817..2f0dba9 100644 --- a/.github/workflows/terraform-apply.yaml +++ b/.github/workflows/terraform-apply.yaml @@ -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 From 4236d56e954c73c57a90d522b0bf7f9b57118452 Mon Sep 17 00:00:00 2001 From: Chi Wai Chan Date: Tue, 8 Oct 2024 13:29:23 +0800 Subject: [PATCH 3/3] Fix terraform format --- .../configs/charmed-openstack-upgrader_main.tfvars | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/terraform-plans/configs/charmed-openstack-upgrader_main.tfvars b/terraform-plans/configs/charmed-openstack-upgrader_main.tfvars index eea7436..30b92a6 100644 --- a/terraform-plans/configs/charmed-openstack-upgrader_main.tfvars +++ b/terraform-plans/configs/charmed-openstack-upgrader_main.tfvars @@ -28,8 +28,8 @@ templates = { source = "./templates/github/jira_sync_config.yaml.tftpl" destination = ".github/.jira_sync_config.yaml" vars = { - component = "openstack-upgrader", - epic_key = "SOLENG-172" + component = "openstack-upgrader", + epic_key = "SOLENG-172" } } }