Update hooks

This commit is contained in:
IamTheFij 2022-11-02 12:32:27 -07:00
parent a203067400
commit 0996cfbf67
11 changed files with 36 additions and 27 deletions

View File

@ -1,22 +1,26 @@
--- ---
repos: repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform - repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.64.1 rev: v1.76.0
hooks: hooks:
- id: terraform_fmt - id: terraform_fmt
- id: terraform_validate - id: terraform_validate
- id: terraform_providers_lock args:
# - id: terraform_tflint - --tf-init-args=-lockfile=readonly
# - id: terraform_tfsec - id: terraform_tflint
args:
- --args=--config=__GIT_WORKING_DIR__/.tflint.hcl
- id: terraform_tfsec
# - id: terraform_providers_lock
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0 rev: v4.3.0
hooks: hooks:
- id: check-added-large-files - id: check-added-large-files
- id: check-merge-conflict - id: check-merge-conflict
- id: end-of-file-fixer - id: end-of-file-fixer
- id: trailing-whitespace - id: trailing-whitespace
- repo: https://github.com/Yelp/detect-secrets - repo: https://github.com/Yelp/detect-secrets
rev: v1.2.0 rev: v1.4.0
hooks: hooks:
- id: detect-secrets - id: detect-secrets
args: ['--baseline', '.secrets-baseline'] args: ['--baseline', '.secrets-baseline']

View File

@ -1,5 +1,5 @@
{ {
"version": "1.2.0", "version": "1.4.0",
"plugins_used": [ "plugins_used": [
{ {
"name": "ArtifactoryDetector" "name": "ArtifactoryDetector"

7
.tflint.hcl Normal file
View File

@ -0,0 +1,7 @@
rule "terraform_required_version" {
enabled = false
}
rule "terraform_required_providers" {
enabled = false
}

View File

@ -8,7 +8,7 @@ locals {
config_data = templatefile( config_data = templatefile(
"${path.module}/config.yml", "${path.module}/config.yml",
{ {
"base_hostname" = "${var.base_hostname}", "base_hostname" = var.base_hostname,
} }
) )
} }
@ -17,7 +17,7 @@ resource "nomad_job" "blocky" {
hcl2 { hcl2 {
enabled = true enabled = true
vars = { vars = {
"config_data" = "${local.config_data}", "config_data" = local.config_data,
} }
} }

View File

@ -6,12 +6,6 @@ resource "nomad_job" "exporters" {
jobspec = file("${path.module}/exporters.nomad") jobspec = file("${path.module}/exporters.nomad")
} }
data "consul_nodes" "all-nodes" {
query_options {
datacenter = "dc1"
}
}
resource "nomad_job" "prometheus" { resource "nomad_job" "prometheus" {
hcl2 { hcl2 {
enabled = true enabled = true
@ -26,7 +20,7 @@ resource "nomad_job" "grafana" {
} }
jobspec = templatefile("${path.module}/grafana.nomad", { jobspec = templatefile("${path.module}/grafana.nomad", {
module_path = "${path.module}" module_path = path.module
}) })
} }

View File

@ -8,7 +8,7 @@ resource "nomad_job" "traefik" {
hcl2 { hcl2 {
enabled = true enabled = true
vars = { vars = {
"base_hostname" = "${var.base_hostname}", "base_hostname" = var.base_hostname,
} }
} }

View File

@ -1,5 +1,5 @@
pre-commit pre-commit
detect-secrets==1.2.0 detect-secrets==1.4.0 # This should match what is in .pre-commit-config.yaml
ansible ansible
python-consul python-consul
hvac hvac

View File

@ -10,3 +10,7 @@
# module "storage_plugins" { # module "storage_plugins" {
# source = "./storage_plugins" # source = "./storage_plugins"
# } # }
terraform {
required_version = ">=1.2.9"
}

View File

@ -1,6 +1,6 @@
resource "nomad_job" "backups" { resource "nomad_job" "backups" {
jobspec = templatefile("${path.module}/backup.nomad", { jobspec = templatefile("${path.module}/backup.nomad", {
module_path = "${path.module}", module_path = path.module,
batch_node = null, batch_node = null,
}) })
} }
@ -18,7 +18,7 @@ resource "nomad_job" "backups-oneoff" {
# node.node_name # node.node_name
# ]) # ])
jobspec = templatefile("${path.module}/backup.nomad", { jobspec = templatefile("${path.module}/backup.nomad", {
module_path = "${path.module}", module_path = path.module,
batch_node = each.key, batch_node = each.key,
}) })
} }

View File

@ -6,7 +6,7 @@ resource "nomad_job" "nextcloud" {
hcl2 { hcl2 {
enabled = true enabled = true
vars = { vars = {
"backup_config" = "${local.backup_config}", "backup_config" = local.backup_config,
} }
} }

View File

@ -28,9 +28,9 @@ resource "nomad_job" "storage-controller" {
hcl2 { hcl2 {
enabled = true enabled = true
vars = { vars = {
"image_name" = "${var.image_name}", "image_name" = var.image_name,
"csi_version" = "${var.csi_version}", "csi_version" = var.csi_version,
"config_data" = "${local.democratic_nfs_config}" "config_data" = local.democratic_nfs_config
} }
} }
@ -41,9 +41,9 @@ resource "nomad_job" "storage-node" {
hcl2 { hcl2 {
enabled = true enabled = true
vars = { vars = {
"image_name" = "${var.image_name}", "image_name" = var.image_name,
"csi_version" = "${var.csi_version}", "csi_version" = var.csi_version,
"config_data" = "${local.democratic_nfs_config}" "config_data" = local.democratic_nfs_config
} }
} }