From 3a7734b21b69ae533fa069f0dfa8d7e98222d159 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Mon, 30 Oct 2023 15:09:26 +0100 Subject: conflatorio/telegraf --- terraform/telegraf/conflatorio/.terraform.lock.hcl | 60 ++++++++++++ terraform/telegraf/conflatorio/ansible-config.yml | 12 +++ terraform/telegraf/conflatorio/backend.tf | 12 +++ terraform/telegraf/conflatorio/main.tf | 37 ++++++++ terraform/telegraf/conflatorio/telegraf.tf | 105 +++++++++++++++++++++ .../telegraf/conflatorio/templates/telegraf.conf | 20 ++++ terraform/telegraf/conflatorio/terragrunt.hcl | 3 + terraform/telegraf/conflatorio/vault.yml | 22 +++++ 8 files changed, 271 insertions(+) create mode 100644 terraform/telegraf/conflatorio/.terraform.lock.hcl create mode 100644 terraform/telegraf/conflatorio/ansible-config.yml create mode 100644 terraform/telegraf/conflatorio/backend.tf create mode 100644 terraform/telegraf/conflatorio/main.tf create mode 100644 terraform/telegraf/conflatorio/telegraf.tf create mode 100644 terraform/telegraf/conflatorio/templates/telegraf.conf create mode 100644 terraform/telegraf/conflatorio/terragrunt.hcl create mode 100644 terraform/telegraf/conflatorio/vault.yml (limited to 'terraform/telegraf') diff --git a/terraform/telegraf/conflatorio/.terraform.lock.hcl b/terraform/telegraf/conflatorio/.terraform.lock.hcl new file mode 100644 index 0000000..5afe9c5 --- /dev/null +++ b/terraform/telegraf/conflatorio/.terraform.lock.hcl @@ -0,0 +1,60 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/hashicorp/template" { + version = "2.2.0" + hashes = [ + "h1:94qn780bi1qjrbC3uQtjJh3Wkfwd5+tTtJHOb7KTg9w=", + "zh:01702196f0a0492ec07917db7aaa595843d8f171dc195f4c988d2ffca2a06386", + "zh:09aae3da826ba3d7df69efeb25d146a1de0d03e951d35019a0f80e4f58c89b53", + "zh:09ba83c0625b6fe0a954da6fbd0c355ac0b7f07f86c91a2a97849140fea49603", + "zh:0e3a6c8e16f17f19010accd0844187d524580d9fdb0731f675ffcf4afba03d16", + "zh:45f2c594b6f2f34ea663704cc72048b212fe7d16fb4cfd959365fa997228a776", + "zh:77ea3e5a0446784d77114b5e851c970a3dde1e08fa6de38210b8385d7605d451", + "zh:8a154388f3708e3df5a69122a23bdfaf760a523788a5081976b3d5616f7d30ae", + "zh:992843002f2db5a11e626b3fc23dc0c87ad3729b3b3cff08e32ffb3df97edbde", + "zh:ad906f4cebd3ec5e43d5cd6dc8f4c5c9cc3b33d2243c89c5fc18f97f7277b51d", + "zh:c979425ddb256511137ecd093e23283234da0154b7fa8b21c2687182d9aea8b2", + ] +} + +provider "registry.terraform.io/kreuzwerker/docker" { + version = "2.24.0" + constraints = "2.24.0" + hashes = [ + "h1:1z0/qA77T3PS/1m4vRO8UgWjHjk5/v+f3JfGbMyzX18=", + "zh:181fefd55c8eb75efe9815c43fdd76422b57951ef53b5d5f19273a00fdf0e2e2", + "zh:2ec84e029d169f188be2addf7f45c2555f226f67d4b6fb66c1749ed5b2c4a76a", + "zh:6f5cf945148485f57b919d31a30f1a5a93d45f4e8edfdb0b80b22258d51795d8", + "zh:8d00c2c459a48453f52a00a8d1ffdb7bcf72fe4b3b09ffcfd52218c4646fa7fa", + "zh:9bd6e06601e0a972b9ce01150e32e76b76b4caf1d9798daf4cf16d06e2a8d4a3", + "zh:af72591132dc8cd338f293e458403851e6b8a6ac4c4d25a3268940f9763df7aa", + "zh:c4a47c5c7ad2ff1fc5212e69c5ef837a127346264e46ce7b5d13362545e4aa70", + "zh:c6d68f33efcd3372331ed0d58ec49e8b01ddc132934b14d2d45977076950e4b3", + "zh:db228855ae7235095d367f3597719747e5be0dd9ce2206ea02062560b518c08a", + "zh:e8d6ce89642925f2e813d0b829bd5562582de37eaa39351e231ab474383e703a", + "zh:ec83d8c86a918d25eb824cc99f98924ef8949eb69aa40cb5ff2db24369e52d9c", + "zh:ee0032d3d86adeeca7fdd4922bb8db87dbb5cd0093c054ff8efe2260de0b624c", + "zh:f033b70f342f32eeb98c213e6fc7098d7afd22b3146a5cb6173c128b0e86d732", + "zh:f1bc3a2c4f152f8adc9a1f9c852496232ef31073b149945756c13bc9688cf08b", + ] +} + +provider "registry.terraform.io/lokkersp/sops" { + version = "0.6.10" + constraints = "0.6.10" + hashes = [ + "h1:atU8NIBxpNTWY+qBubvEOfjOn4K1aCDoq1iUFocgIHQ=", + "zh:0f053a26392a581b1f1ce6316cb7ed8ec4cc75e7f5f1cf7cfd45050b6b3c87ea", + "zh:207bb96c4471fce9aeb1b3c217d772692c3d865d294cf4d2501dad41de36a15e", + "zh:28506e8f1f3b9eaa95d99043440328044ee6340143535e5751538328a529d001", + "zh:3cae3bcea9e35fdc5b3f2af1b4580cd625c996448ad0c676c772260e46b25289", + "zh:3e44daaf82986c2b0028aeb17b867f3c68ed5dd8ac8625ba0406cf2a5fd3d92e", + "zh:457fb8ca2e677af24f9a4bdd8b613b1d7b604ad7133541657e5757c19268da71", + "zh:473d727c228f021a3df8cc8dcc6231ad7f90ed63f9e47c36b597d591e76228da", + "zh:48c4c1df39fd76ec8bd5fe9ac70cdc0927ac8be95582dbe46458b3442ce0fcd9", + "zh:728b19cb5c07e5e9d8b78fd94cc57d4c13582ecd24b7eb7c4cc2bf73b12fe4d1", + "zh:c51ed9af591779bb0910b82addeebb10f53428b994f8db653dd1dedcec60916c", + "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", + ] +} diff --git a/terraform/telegraf/conflatorio/ansible-config.yml b/terraform/telegraf/conflatorio/ansible-config.yml new file mode 100644 index 0000000..3acab34 --- /dev/null +++ b/terraform/telegraf/conflatorio/ansible-config.yml @@ -0,0 +1,12 @@ +- hosts: + - conflatorio + tasks: + - become: yes + file: + state: directory + path: "/etc/trygvis" + + - become: yes + template: + dest: "/etc/trygvis/telegraf.conf" + src: "telegraf.conf" diff --git a/terraform/telegraf/conflatorio/backend.tf b/terraform/telegraf/conflatorio/backend.tf new file mode 100644 index 0000000..bdc5b52 --- /dev/null +++ b/terraform/telegraf/conflatorio/backend.tf @@ -0,0 +1,12 @@ +# Generated by Terragrunt. Sig: nIlQXj57tbuaRZEa +terraform { + backend "s3" { + bucket = "terraform-a6726272-73ff-11ed-8bdd-c79eb8376e05" + key = "telegraf/conflatorio/terraform.tfstate" + skip_region_validation = true + skip_credentials_validation = true + skip_metadata_api_check = true + region = "eu-central-1" + endpoint = "eu-central-1.linodeobjects.com" + } +} diff --git a/terraform/telegraf/conflatorio/main.tf b/terraform/telegraf/conflatorio/main.tf new file mode 100644 index 0000000..5d94503 --- /dev/null +++ b/terraform/telegraf/conflatorio/main.tf @@ -0,0 +1,37 @@ +terraform { + required_version = "~> 1.3.5" + + required_providers { + docker = { + source = "kreuzwerker/docker" + version = "2.24.0" + } + sops = { + source = "lokkersp/sops" + version = "0.6.10" + } + template = { + source = "hashicorp/template" + version = "2.2.0" + } + } +} + +locals { + ansible_host = "conflatorio" + hostname = "conflatorio.vpn.trygvis.io" + + influx_url = "https://influxdb.vpn.trygvis.io" + influx_token = data.sops_file.vault.data["influx_token"] + influx_organization = "trygvis" + + influx_bucket = "telegraf-lhn2ix" +} + +provider "docker" { + host = "ssh://${local.hostname}" +} + +data "sops_file" "vault" { + source_file = "vault.yml" +} diff --git a/terraform/telegraf/conflatorio/telegraf.tf b/terraform/telegraf/conflatorio/telegraf.tf new file mode 100644 index 0000000..669476a --- /dev/null +++ b/terraform/telegraf/conflatorio/telegraf.tf @@ -0,0 +1,105 @@ +#data "docker_network" "public" { +# name = "public" +#} + +data "docker_registry_image" "telegraf" { + name = "telegraf:1.28.3-alpine" +} + +locals { + docker_gid = 997 + entrypoint = <