Skip to content

Commit

Permalink
Merge pull request #29 from lambchop4prez/terraform-linting
Browse files Browse the repository at this point in the history
Terraform linting
  • Loading branch information
lambchop4prez authored Oct 4, 2023
2 parents a5e7568 + 15d78ff commit ff717ae
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 13 deletions.
8 changes: 7 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ updates:
- directory: .github/
package-ecosystem: github-actions
schedule:
timezone: "05:42 UTC"
time: "05:42"
interval: weekly
day: sunday
- directory: provision/terraform
package-ecosystem: terraform
schedule:
interval: weekly
time: "04:31"
day: monday
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ jobs:
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
- uses: terraform-linters/setup-tflint@19a52fbac37dacb22a09518e4ef6ee234f2d4987 # v4.0.0
- uses: pre-commit-ci/lite-action@2529d76d2c5ffdf2a85aa090c38949eada94d39d # v1.0.1
if: always()
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,8 @@ repos:
# rev: b05e028c5881819161d11cb543fd96a30c06cceb # v1.32.0
# hooks:
# - id: yamllint
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: 66a1469a7c7954d8469d7a6f79f4ffb8c9ae09bf # v1.83.4
hooks:
- id: terraform_fmt
- id: terraform_tflint
6 changes: 3 additions & 3 deletions provision/terraform/servonet/agent_nodes.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ resource "proxmox_vm_qemu" "agent_nodes" {
resource "opnsense_dhcp_static_map" "agent_static_leases" {
count = var.agent_count
interface = "lan"
mac = "${proxmox_vm_qemu.agent_nodes[count.index].network[0].macaddr}"
ipaddr = "${local.agent_ips[count.index]}"
hostname = "${proxmox_vm_qemu.agent_nodes[count.index].name}"
mac = proxmox_vm_qemu.agent_nodes[count.index].network[0].macaddr
ipaddr = local.agent_ips[count.index]
hostname = proxmox_vm_qemu.agent_nodes[count.index].name
}


Expand Down
1 change: 0 additions & 1 deletion provision/terraform/servonet/flux_bootsrap.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

resource "tls_private_key" "flux" {
algorithm = "ECDSA"
ecdsa_curve = "P256"
Expand Down
17 changes: 17 additions & 0 deletions provision/terraform/servonet/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
terraform {
required_providers {
vault = {
source = "hashicorp/vault"
version = "3.17.0"
}
proxmox = {
source = "terraform.local/telmate/proxmox"
version = "2.9.15"
Expand All @@ -14,11 +18,24 @@ terraform {
}
flux = {
source = "fluxcd/flux"
version = "1.0.1"
}
github = {
source = "integrations/github"
version = ">=5.18.0"
}
tls = {
source = "hashicorp/tls"
version = "4.0.5"
}
random = {
source = "hashicorp/random"
version = "3.5.1"
}
local = {
source = "hashicorp/local"
version = "2.4.0"
}
}

required_version = ">= 1.1.5"
Expand Down
2 changes: 0 additions & 2 deletions provision/terraform/servonet/secrets.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
provider "vault" {}

data "vault_generic_secret" "proxmox_auth" {
path = "secrets/proxmox/auth/terraform"
}
Expand Down
6 changes: 3 additions & 3 deletions provision/terraform/servonet/server_init.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ resource "proxmox_vm_qemu" "server_init" {

resource "opnsense_dhcp_static_map" "server_init_static_lease" {
interface = "lan"
mac = "${proxmox_vm_qemu.server_init[0].network[0].macaddr}"
ipaddr = "${local.server_ips[0]}"
hostname = "${proxmox_vm_qemu.server_init[0].name}"
mac = proxmox_vm_qemu.server_init[0].network[0].macaddr
ipaddr = local.server_ips[0]
hostname = proxmox_vm_qemu.server_init[0].name
}

resource "terraform_data" "server_init_cloud_init_config" {
Expand Down
6 changes: 3 additions & 3 deletions provision/terraform/servonet/server_nodes.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ resource "proxmox_vm_qemu" "server_nodes" {
resource "opnsense_dhcp_static_map" "server_static_lease" {
count = var.server_count - 1
interface = "lan"
mac = "${proxmox_vm_qemu.server_nodes[count.index].network[0].macaddr}"
ipaddr = "${local.server_ips[count.index + 1]}"
hostname = "${proxmox_vm_qemu.server_nodes[count.index].name}"
mac = proxmox_vm_qemu.server_nodes[count.index].network[0].macaddr
ipaddr = local.server_ips[count.index + 1]
hostname = proxmox_vm_qemu.server_nodes[count.index].name
}

resource "terraform_data" "server_cloud_init_config" {
Expand Down

0 comments on commit ff717ae

Please sign in to comment.