From 4643d8e1d3df5eca034577b7587cdbdecf2ee8ae Mon Sep 17 00:00:00 2001 From: Matthew Baggett Date: Fri, 21 Jun 2024 15:43:35 +0200 Subject: [PATCH] :tada: Initial commit. --- .gitignore | 5 ++++ .terraform.lock.hcl | 66 +++++++++++++++++++++++++++++++++++++++++++++ README.md | 5 +++- docker.tf | 21 +++++++++++++++ terraform.tf | 16 +++++++++++ 5 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 .terraform.lock.hcl create mode 100644 docker.tf create mode 100644 terraform.tf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..072c29b --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +/.idea +/.terraform +/terraform.tfstate* +/.terraform.tfstate* +/.github/cache diff --git a/.terraform.lock.hcl b/.terraform.lock.hcl new file mode 100644 index 0000000..bc3a7a2 --- /dev/null +++ b/.terraform.lock.hcl @@ -0,0 +1,66 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/hashicorp/random" { + version = "3.6.2" + constraints = "~> 3.3" + hashes = [ + "h1:wmG0QFjQ2OfyPy6BB7mQ57WtoZZGGV07uAPQeDmIrAE=", + "zh:0ef01a4f81147b32c1bea3429974d4d104bbc4be2ba3cfa667031a8183ef88ec", + "zh:1bcd2d8161e89e39886119965ef0f37fcce2da9c1aca34263dd3002ba05fcb53", + "zh:37c75d15e9514556a5f4ed02e1548aaa95c0ecd6ff9af1119ac905144c70c114", + "zh:4210550a767226976bc7e57d988b9ce48f4411fa8a60cd74a6b246baf7589dad", + "zh:562007382520cd4baa7320f35e1370ffe84e46ed4e2071fdc7e4b1a9b1f8ae9b", + "zh:5efb9da90f665e43f22c2e13e0ce48e86cae2d960aaf1abf721b497f32025916", + "zh:6f71257a6b1218d02a573fc9bff0657410404fb2ef23bc66ae8cd968f98d5ff6", + "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", + "zh:9647e18f221380a85f2f0ab387c68fdafd58af6193a932417299cdcae4710150", + "zh:bb6297ce412c3c2fa9fec726114e5e0508dd2638cad6a0cb433194930c97a544", + "zh:f83e925ed73ff8a5ef6e3608ad9225baa5376446349572c2449c0c0b3cf184b7", + "zh:fbef0781cb64de76b1df1ca11078aecba7800d82fd4a956302734999cfd9a4af", + ] +} + +provider "registry.terraform.io/kreuzwerker/docker" { + version = "3.0.2" + constraints = "~> 3.0" + hashes = [ + "h1:cT2ccWOtlfKYBUE60/v2/4Q6Stk1KYTNnhxSck+VPlU=", + "zh:15b0a2b2b563d8d40f62f83057d91acb02cd0096f207488d8b4298a59203d64f", + "zh:23d919de139f7cd5ebfd2ff1b94e6d9913f0977fcfc2ca02e1573be53e269f95", + "zh:38081b3fe317c7e9555b2aaad325ad3fa516a886d2dfa8605ae6a809c1072138", + "zh:4a9c5065b178082f79ad8160243369c185214d874ff5048556d48d3edd03c4da", + "zh:5438ef6afe057945f28bce43d76c4401254073de01a774760169ac1058830ac2", + "zh:60b7fadc287166e5c9873dfe53a7976d98244979e0ab66428ea0dea1ebf33e06", + "zh:61c5ec1cb94e4c4a4fb1e4a24576d5f39a955f09afb17dab982de62b70a9bdd1", + "zh:a38fe9016ace5f911ab00c88e64b156ebbbbfb72a51a44da3c13d442cd214710", + "zh:c2c4d2b1fd9ebb291c57f524b3bf9d0994ff3e815c0cd9c9bcb87166dc687005", + "zh:d567bb8ce483ab2cf0602e07eae57027a1a53994aba470fa76095912a505533d", + "zh:e83bf05ab6a19dd8c43547ce9a8a511f8c331a124d11ac64687c764ab9d5a792", + "zh:e90c934b5cd65516fbcc454c89a150bfa726e7cf1fe749790c7480bbeb19d387", + "zh:f05f167d2eaf913045d8e7b88c13757e3cf595dd5cd333057fdafc7c4b7fed62", + "zh:fcc9c1cea5ce85e8bcb593862e699a881bd36dffd29e2e367f82d15368659c3d", + ] +} + +provider "registry.terraform.io/matthewbaggett/ssh" { + version = "0.1.0" + constraints = "~> 0.1.0" + hashes = [ + "h1:SxQbhwpQ9TS6PLdN/4rCyjxDCPJsM+nquA4RQUEzrsQ=", + "zh:1bba8b9fd155f3d71c0a5e42eaa92a2faec19be68e5479785bbde9ad9b8e697a", + "zh:1ce5c202125b80c435e27f501965f64f7488cfc40d715c4f023e1794330ff7c9", + "zh:3cdfdac04c3eac04d45a8cbe9e2254bc94443d6d05d882d13d10032e26a264eb", + "zh:45973037512fffc67d28bb5aac8f756672865ddc7341dc65d84436c05eb9f8fe", + "zh:5affb221c721c81d22911fe7979d1d085c021610116021b505182867b249fbbb", + "zh:78871544213020bfbafb7385d185fe375b131aee3f63be0e854cfd8408f82cfd", + "zh:7c08ca244bb1a5cf01928041fa62a2cd8a7c165e9f4720578e8e3a0dda684c4a", + "zh:a8916127d3e6d387423ea860fa17d1e7e07fcb0fbce94221843126432b4ad390", + "zh:b9a522829deea70d69c7f4ad41ca39dda0e0db90ee4427defba2ebf5d7c35f12", + "zh:bb2ca617be81bfbc5ace84e74d23255f5686d3c67e12b288ed415544791bfac9", + "zh:cd13814aa01425c941b6902a8a4017fbca8a498115caa5477054605fb2cb843c", + "zh:cd1844e44ea9de70a6d70d4db76ba2f903d055ac8d1b60a5c76d09495366a709", + "zh:d2cb9df920e7b128d8b87bfd6aabfca2bca4cdb9977b254d1e059c29a90d0e12", + "zh:d2f7677b7b27ae80395bc4e7606cb25fb1c84770a1b6a7042dcc6b92558c7d1b", + ] +} diff --git a/README.md b/README.md index e032c68..1aff114 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ -# iac +Grey's Docker Swarm does IAC +============================ + +Or: How I learned to stop worrying and love the swarm. diff --git a/docker.tf b/docker.tf new file mode 100644 index 0000000..b4ff144 --- /dev/null +++ b/docker.tf @@ -0,0 +1,21 @@ +provider "ssh" { + server = { + host = "california.ti" + port = 22 + } + user = "techinc" + auth = { + private_key = { + content = file("~/.ssh/keys/exploding_bolts_2_rsa") + } + } +} +data "ssh_tunnel" "docker" { + connection_name = "docker_socket_tunnel_california" + remote = { + socket = "/var/run/docker.sock" + } +} +provider "docker" { + host = "tcp://${data.ssh_tunnel.docker.local.address}" +} diff --git a/terraform.tf b/terraform.tf new file mode 100644 index 0000000..4804aa2 --- /dev/null +++ b/terraform.tf @@ -0,0 +1,16 @@ +terraform { + required_providers { + docker = { + source = "kreuzwerker/docker" + version = "~>3.0" + } + random = { + source = "hashicorp/random" + version = "~>3.3" + } + ssh = { + source = "matthewbaggett/ssh" + version = "~> 0.1.0" + } + } +}