From 97f5118bd183fa2c332dc3a7e59b24088061ca95 Mon Sep 17 00:00:00 2001 From: Ahosking Date: Fri, 21 May 2021 09:13:50 -0400 Subject: [PATCH] Update home IP and script plus assets IP --- ahoskingit/terraform/.terraform.lock.hcl | 59 +++++++++ ahoskingit/terraform/dns_automatedbytes.tf | 6 +- ahoskingit/terraform/get_current_ip.sh | 10 +- ahoskingit/terraform/homeip.auto.tfvars | 2 +- ahoskingit/terraform/terraform.tfstate | 46 +++---- ahoskingit/terraform/terraform.tfstate.backup | 112 +++++++++++++++--- ahoskingit/terraform/var_homeip.tfvar | 1 - ahoskingit/terraform/variables.tf | 4 + 8 files changed, 192 insertions(+), 48 deletions(-) create mode 100755 ahoskingit/terraform/.terraform.lock.hcl delete mode 100644 ahoskingit/terraform/var_homeip.tfvar diff --git a/ahoskingit/terraform/.terraform.lock.hcl b/ahoskingit/terraform/.terraform.lock.hcl new file mode 100755 index 0000000..bacc97b --- /dev/null +++ b/ahoskingit/terraform/.terraform.lock.hcl @@ -0,0 +1,59 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/cloudflare/cloudflare" { + version = "2.17.0" + constraints = "2.17.0" + hashes = [ + "h1:Y2YvQIMTWnl2xz82+5gOVo3zSgQFpk7o/CadXP+Ad6w=", + "zh:05d97d21dea9acc20cb88885e658508bf23a09d2561eb203be70248f9bb7ee68", + "zh:23ee7136382586ca1f6e5a2df6751a22e29cd4060dab0bc613b702b2edf3881c", + "zh:2fc9647ded9459118966b6883372c4707f232220525ef56b488de738cf9c5e78", + "zh:31624f7efb0c93461cb54f5197c6af891ba8ccb540362356b5722509a00f3976", + "zh:3ded9720928dac2b6027e3c074511f9717726fd2e67feb17f764a3766ff22d3f", + "zh:623c689e580dd3cd4d75a713e40583590d343ceb801e6ffbc6d90d43be85cf6f", + "zh:63191d6bf16c9307d98ee4c31637e74687599baa05266218c5a32ed22f28b06b", + "zh:697955f294fff567b3862e6d0e7f2bbcfcfa8bfb58be28efca2fda00d9b7ebaa", + "zh:d4980aacac7f2e6c24e9072b284af77f0c5ad485c48a1ff041efeee3beacec58", + "zh:e5d4e2595034fc6a7382409aef91425d8a21473532774edce60166205ee0e4af", + "zh:f1b2f956748aba79be2f74b68035055cc99fdb6cdb2b5183e119be00c13bcda4", + ] +} + +provider "registry.terraform.io/hashicorp/aws" { + version = "2.70.0" + constraints = "~> 2.0" + hashes = [ + "h1:6tf4jg37RrMHyVCql+fEgAFvX8JiqDognr+lk6rx7To=", + "zh:01a5f351146434b418f9ff8d8cc956ddc801110f1cc8b139e01be2ff8c544605", + "zh:1ec08abbaf09e3e0547511d48f77a1e2c89face2d55886b23f643011c76cb247", + "zh:606d134fef7c1357c9d155aadbee6826bc22bc0115b6291d483bc1444291c3e1", + "zh:67e31a71a5ecbbc96a1a6708c9cc300bbfe921c322320cdbb95b9002026387e1", + "zh:75aa59ae6f0834ed7142c81569182a658e4c22724a34db5d10f7545857d8db0c", + "zh:76880f29fca7a0a3ff1caef31d245af2fb12a40709d67262e099bc22d039a51d", + "zh:aaeaf97ffc1f76714e68bc0242c7407484c783d604584c04ad0b267b6812b6dc", + "zh:ae1f88d19cc85b2e9b6ef71994134d55ef7830fd02f1f3c58c0b3f2b90e8b337", + "zh:b155bdda487461e7b3d6e3a8d5ce5c887a047e4d983512e81e2c8266009f2a1f", + "zh:ba394a7c391a26c4a91da63ad680e83bde0bc1ecc0a0856e26e9d62a4e77c408", + "zh:e243c9d91feb0979638f28eb26f89ebadc179c57a2bd299b5729fb52bd1902f2", + "zh:f6c05e20d9a3fba76ca5f47206dde35e5b43b6821c6cbf57186164ce27ba9f15", + ] +} + +provider "registry.terraform.io/terraform-providers/cloudflare" { + version = "2.17.0" + hashes = [ + "h1:Y2YvQIMTWnl2xz82+5gOVo3zSgQFpk7o/CadXP+Ad6w=", + "zh:05d97d21dea9acc20cb88885e658508bf23a09d2561eb203be70248f9bb7ee68", + "zh:23ee7136382586ca1f6e5a2df6751a22e29cd4060dab0bc613b702b2edf3881c", + "zh:2fc9647ded9459118966b6883372c4707f232220525ef56b488de738cf9c5e78", + "zh:31624f7efb0c93461cb54f5197c6af891ba8ccb540362356b5722509a00f3976", + "zh:3ded9720928dac2b6027e3c074511f9717726fd2e67feb17f764a3766ff22d3f", + "zh:623c689e580dd3cd4d75a713e40583590d343ceb801e6ffbc6d90d43be85cf6f", + "zh:63191d6bf16c9307d98ee4c31637e74687599baa05266218c5a32ed22f28b06b", + "zh:697955f294fff567b3862e6d0e7f2bbcfcfa8bfb58be28efca2fda00d9b7ebaa", + "zh:d4980aacac7f2e6c24e9072b284af77f0c5ad485c48a1ff041efeee3beacec58", + "zh:e5d4e2595034fc6a7382409aef91425d8a21473532774edce60166205ee0e4af", + "zh:f1b2f956748aba79be2f74b68035055cc99fdb6cdb2b5183e119be00c13bcda4", + ] +} diff --git a/ahoskingit/terraform/dns_automatedbytes.tf b/ahoskingit/terraform/dns_automatedbytes.tf index 364e59e..75e5ca6 100644 --- a/ahoskingit/terraform/dns_automatedbytes.tf +++ b/ahoskingit/terraform/dns_automatedbytes.tf @@ -67,7 +67,7 @@ resource "cloudflare_record" "assets_automatedbytes" { name = "assets" type = "A" proxied = true - value = var.home_ip + value = var.do_assets } resource "cloudflare_record" "assets_api_automatedbytes" { @@ -75,7 +75,7 @@ resource "cloudflare_record" "assets_api_automatedbytes" { name = "assets-api" type = "A" proxied = true - value = var.home_ip + value = var.do_assets } resource "cloudflare_record" "assets_mesh_automatedbytes" { @@ -83,7 +83,7 @@ resource "cloudflare_record" "assets_mesh_automatedbytes" { name = "assets-mesh" type = "A" proxied = true - value = var.home_ip + value = var.do_assets } resource "cloudflare_record" "support_automatedbytes" { diff --git a/ahoskingit/terraform/get_current_ip.sh b/ahoskingit/terraform/get_current_ip.sh index 64f0559..a76c01e 100755 --- a/ahoskingit/terraform/get_current_ip.sh +++ b/ahoskingit/terraform/get_current_ip.sh @@ -1,3 +1,9 @@ #!/bin/bash -IP=`curl ifconfig.co` -echo 'home_ip = "'$IP'"' > var_homeip.tfvar +DATE=`date` +OLD_IP=`cat /home/ahosking/projects/ahoskingit/orchestration.clouds/ahoskingit/terraform/homeip.auto.tfvars` +IP=`curl ifconfig.me` +echo 'home_ip = "'$IP'"' > homeip.auto.tfvars +MESSAGE="'$DATE' - Old IP was: '$OLD_IP' and the new IP is: '$IP'" +#echo $DATE + +echo $MESSAGE diff --git a/ahoskingit/terraform/homeip.auto.tfvars b/ahoskingit/terraform/homeip.auto.tfvars index 98d0271..d340398 100644 --- a/ahoskingit/terraform/homeip.auto.tfvars +++ b/ahoskingit/terraform/homeip.auto.tfvars @@ -1 +1 @@ -home_ip = "174.93.115.121" +home_ip = "174.91.157.243" diff --git a/ahoskingit/terraform/terraform.tfstate b/ahoskingit/terraform/terraform.tfstate index 61bd153..d0abc97 100644 --- a/ahoskingit/terraform/terraform.tfstate +++ b/ahoskingit/terraform/terraform.tfstate @@ -1,7 +1,7 @@ { "version": 4, - "terraform_version": "0.14.3", - "serial": 182, + "terraform_version": "0.14.5", + "serial": 202, "lineage": "db7d87ff-3078-47ed-a0a9-91749a2dbba5", "outputs": {}, "resources": [ @@ -170,7 +170,7 @@ "multivalue_answer_routing_policy": null, "name": "automatedbytes.com", "records": [ - "174.93.115.121" + "174.91.157.243" ], "set_identifier": "", "ttl": 5, @@ -350,7 +350,7 @@ "multivalue_answer_routing_policy": null, "name": "home.ahoskingit.ca", "records": [ - "174.93.115.121" + "174.91.157.243" ], "set_identifier": "", "ttl": 5, @@ -604,7 +604,7 @@ "multivalue_answer_routing_policy": null, "name": "support.automatedbytes.com", "records": [ - "174.93.115.121" + "174.91.157.243" ], "set_identifier": "", "ttl": 5, @@ -1664,7 +1664,7 @@ "schema_version": 1, "attributes": { "created_on": "2021-05-19T03:32:43.128549Z", - "data": null, + "data": {}, "hostname": "assets-api.automatedbytes.com", "id": "836a0076e233224ddea40c0a48912634", "metadata": { @@ -1673,7 +1673,7 @@ "managed_by_argo_tunnel": "false", "source": "primary" }, - "modified_on": "2021-05-19T03:32:43.128549Z", + "modified_on": "2021-05-21T13:12:25.177863Z", "name": "assets-api", "priority": 0, "proxiable": true, @@ -1681,7 +1681,7 @@ "timeouts": null, "ttl": 1, "type": "A", - "value": "174.93.115.121", + "value": "165.22.228.138", "zone_id": "17ce22c4db27214cd0ec8f490fe07404" }, "sensitive_attributes": [], @@ -1711,7 +1711,7 @@ "managed_by_argo_tunnel": "false", "source": "primary" }, - "modified_on": "2021-05-19T02:54:26.930574Z", + "modified_on": "2021-05-21T13:12:25.538604Z", "name": "assets", "priority": 0, "proxiable": true, @@ -1719,7 +1719,7 @@ "timeouts": null, "ttl": 1, "type": "A", - "value": "174.93.115.121", + "value": "165.22.228.138", "zone_id": "17ce22c4db27214cd0ec8f490fe07404" }, "sensitive_attributes": [], @@ -1740,7 +1740,7 @@ "schema_version": 1, "attributes": { "created_on": "2021-05-19T03:32:42.903823Z", - "data": null, + "data": {}, "hostname": "assets-mesh.automatedbytes.com", "id": "03c5eda7801dd0d3a3f6ef1c83570d62", "metadata": { @@ -1749,7 +1749,7 @@ "managed_by_argo_tunnel": "false", "source": "primary" }, - "modified_on": "2021-05-19T03:32:42.903823Z", + "modified_on": "2021-05-21T13:12:25.6552Z", "name": "assets-mesh", "priority": 0, "proxiable": true, @@ -1757,7 +1757,7 @@ "timeouts": null, "ttl": 1, "type": "A", - "value": "174.93.115.121", + "value": "165.22.228.138", "zone_id": "17ce22c4db27214cd0ec8f490fe07404" }, "sensitive_attributes": [], @@ -1863,7 +1863,7 @@ "managed_by_argo_tunnel": "false", "source": "primary" }, - "modified_on": "2021-03-30T04:41:58.040133Z", + "modified_on": "2021-05-21T13:04:48.976538Z", "name": "git", "priority": 0, "proxiable": true, @@ -1871,7 +1871,7 @@ "timeouts": null, "ttl": 1, "type": "A", - "value": "174.93.115.121", + "value": "174.91.157.243", "zone_id": "6b3fe5493c79efccf633719ab48ef00f" }, "sensitive_attributes": [], @@ -1977,7 +1977,7 @@ "managed_by_argo_tunnel": "false", "source": "primary" }, - "modified_on": "2021-03-30T04:41:57.527043Z", + "modified_on": "2021-05-21T13:04:49.485715Z", "name": "home", "priority": 0, "proxiable": true, @@ -1985,7 +1985,7 @@ "timeouts": null, "ttl": 1, "type": "A", - "value": "174.93.115.121", + "value": "174.91.157.243", "zone_id": "6b3fe5493c79efccf633719ab48ef00f" }, "sensitive_attributes": [], @@ -2128,7 +2128,7 @@ "managed_by_argo_tunnel": "false", "source": "primary" }, - "modified_on": "2021-03-30T04:41:57.03537Z", + "modified_on": "2021-05-21T13:04:48.741923Z", "name": "logs", "priority": 0, "proxiable": true, @@ -2136,7 +2136,7 @@ "timeouts": null, "ttl": 1, "type": "A", - "value": "174.93.115.121", + "value": "174.91.157.243", "zone_id": "6b3fe5493c79efccf633719ab48ef00f" }, "sensitive_attributes": [], @@ -2578,7 +2578,7 @@ "managed_by_argo_tunnel": "false", "source": "primary" }, - "modified_on": "2021-03-30T04:41:57.269418Z", + "modified_on": "2021-05-21T13:04:48.005917Z", "name": "studi-odesigns.com", "priority": 0, "proxiable": true, @@ -2586,7 +2586,7 @@ "timeouts": null, "ttl": 1, "type": "A", - "value": "174.93.115.121", + "value": "174.91.157.243", "zone_id": "48662c59622a201785e89888f5154bd2" }, "sensitive_attributes": [], @@ -2913,7 +2913,7 @@ "managed_by_argo_tunnel": "false", "source": "primary" }, - "modified_on": "2021-03-30T04:41:57.778814Z", + "modified_on": "2021-05-21T13:04:48.471318Z", "name": "support", "priority": 0, "proxiable": true, @@ -2921,7 +2921,7 @@ "timeouts": null, "ttl": 1, "type": "A", - "value": "174.93.115.121", + "value": "174.91.157.243", "zone_id": "17ce22c4db27214cd0ec8f490fe07404" }, "sensitive_attributes": [], diff --git a/ahoskingit/terraform/terraform.tfstate.backup b/ahoskingit/terraform/terraform.tfstate.backup index 3e00a09..e50caea 100644 --- a/ahoskingit/terraform/terraform.tfstate.backup +++ b/ahoskingit/terraform/terraform.tfstate.backup @@ -1,7 +1,7 @@ { "version": 4, - "terraform_version": "0.14.3", - "serial": 179, + "terraform_version": "0.14.5", + "serial": 198, "lineage": "db7d87ff-3078-47ed-a0a9-91749a2dbba5", "outputs": {}, "resources": [ @@ -170,7 +170,7 @@ "multivalue_answer_routing_policy": null, "name": "automatedbytes.com", "records": [ - "174.93.115.121" + "174.91.157.243" ], "set_identifier": "", "ttl": 5, @@ -350,7 +350,7 @@ "multivalue_answer_routing_policy": null, "name": "home.ahoskingit.ca", "records": [ - "174.93.115.121" + "174.91.157.243" ], "set_identifier": "", "ttl": 5, @@ -604,7 +604,7 @@ "multivalue_answer_routing_policy": null, "name": "support.automatedbytes.com", "records": [ - "174.93.115.121" + "174.91.157.243" ], "set_identifier": "", "ttl": 5, @@ -1654,6 +1654,44 @@ } ] }, + { + "mode": "managed", + "type": "cloudflare_record", + "name": "assets_api_automatedbytes", + "provider": "provider[\"registry.terraform.io/cloudflare/cloudflare\"]", + "instances": [ + { + "schema_version": 1, + "attributes": { + "created_on": "2021-05-19T03:32:43.128549Z", + "data": {}, + "hostname": "assets-api.automatedbytes.com", + "id": "836a0076e233224ddea40c0a48912634", + "metadata": { + "auto_added": "false", + "managed_by_apps": "false", + "managed_by_argo_tunnel": "false", + "source": "primary" + }, + "modified_on": "2021-05-21T13:04:49.721626Z", + "name": "assets-api", + "priority": 0, + "proxiable": true, + "proxied": true, + "timeouts": null, + "ttl": 1, + "type": "A", + "value": "174.91.157.243", + "zone_id": "17ce22c4db27214cd0ec8f490fe07404" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozMDAwMDAwMDAwMCwidXBkYXRlIjozMDAwMDAwMDAwMH0sInNjaGVtYV92ZXJzaW9uIjoiMSJ9", + "dependencies": [ + "cloudflare_zone.automatedbytes_com" + ] + } + ] + }, { "mode": "managed", "type": "cloudflare_record", @@ -1664,7 +1702,7 @@ "schema_version": 1, "attributes": { "created_on": "2021-05-19T02:54:26.930574Z", - "data": null, + "data": {}, "hostname": "assets.automatedbytes.com", "id": "e3a0edc1bd2cfbffb900e7656af71329", "metadata": { @@ -1673,7 +1711,7 @@ "managed_by_argo_tunnel": "false", "source": "primary" }, - "modified_on": "2021-05-19T02:54:26.930574Z", + "modified_on": "2021-05-21T13:04:48.266744Z", "name": "assets", "priority": 0, "proxiable": true, @@ -1681,7 +1719,45 @@ "timeouts": null, "ttl": 1, "type": "A", - "value": "174.93.115.121", + "value": "174.91.157.243", + "zone_id": "17ce22c4db27214cd0ec8f490fe07404" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozMDAwMDAwMDAwMCwidXBkYXRlIjozMDAwMDAwMDAwMH0sInNjaGVtYV92ZXJzaW9uIjoiMSJ9", + "dependencies": [ + "cloudflare_zone.automatedbytes_com" + ] + } + ] + }, + { + "mode": "managed", + "type": "cloudflare_record", + "name": "assets_mesh_automatedbytes", + "provider": "provider[\"registry.terraform.io/cloudflare/cloudflare\"]", + "instances": [ + { + "schema_version": 1, + "attributes": { + "created_on": "2021-05-19T03:32:42.903823Z", + "data": {}, + "hostname": "assets-mesh.automatedbytes.com", + "id": "03c5eda7801dd0d3a3f6ef1c83570d62", + "metadata": { + "auto_added": "false", + "managed_by_apps": "false", + "managed_by_argo_tunnel": "false", + "source": "primary" + }, + "modified_on": "2021-05-21T13:04:49.22489Z", + "name": "assets-mesh", + "priority": 0, + "proxiable": true, + "proxied": true, + "timeouts": null, + "ttl": 1, + "type": "A", + "value": "174.91.157.243", "zone_id": "17ce22c4db27214cd0ec8f490fe07404" }, "sensitive_attributes": [], @@ -1787,7 +1863,7 @@ "managed_by_argo_tunnel": "false", "source": "primary" }, - "modified_on": "2021-03-30T04:41:58.040133Z", + "modified_on": "2021-05-21T13:04:48.976538Z", "name": "git", "priority": 0, "proxiable": true, @@ -1795,7 +1871,7 @@ "timeouts": null, "ttl": 1, "type": "A", - "value": "174.93.115.121", + "value": "174.91.157.243", "zone_id": "6b3fe5493c79efccf633719ab48ef00f" }, "sensitive_attributes": [], @@ -1901,7 +1977,7 @@ "managed_by_argo_tunnel": "false", "source": "primary" }, - "modified_on": "2021-03-30T04:41:57.527043Z", + "modified_on": "2021-05-21T13:04:49.485715Z", "name": "home", "priority": 0, "proxiable": true, @@ -1909,7 +1985,7 @@ "timeouts": null, "ttl": 1, "type": "A", - "value": "174.93.115.121", + "value": "174.91.157.243", "zone_id": "6b3fe5493c79efccf633719ab48ef00f" }, "sensitive_attributes": [], @@ -2052,7 +2128,7 @@ "managed_by_argo_tunnel": "false", "source": "primary" }, - "modified_on": "2021-03-30T04:41:57.03537Z", + "modified_on": "2021-05-21T13:04:48.741923Z", "name": "logs", "priority": 0, "proxiable": true, @@ -2060,7 +2136,7 @@ "timeouts": null, "ttl": 1, "type": "A", - "value": "174.93.115.121", + "value": "174.91.157.243", "zone_id": "6b3fe5493c79efccf633719ab48ef00f" }, "sensitive_attributes": [], @@ -2502,7 +2578,7 @@ "managed_by_argo_tunnel": "false", "source": "primary" }, - "modified_on": "2021-03-30T04:41:57.269418Z", + "modified_on": "2021-05-21T13:04:48.005917Z", "name": "studi-odesigns.com", "priority": 0, "proxiable": true, @@ -2510,7 +2586,7 @@ "timeouts": null, "ttl": 1, "type": "A", - "value": "174.93.115.121", + "value": "174.91.157.243", "zone_id": "48662c59622a201785e89888f5154bd2" }, "sensitive_attributes": [], @@ -2837,7 +2913,7 @@ "managed_by_argo_tunnel": "false", "source": "primary" }, - "modified_on": "2021-03-30T04:41:57.778814Z", + "modified_on": "2021-05-21T13:04:48.471318Z", "name": "support", "priority": 0, "proxiable": true, @@ -2845,7 +2921,7 @@ "timeouts": null, "ttl": 1, "type": "A", - "value": "174.93.115.121", + "value": "174.91.157.243", "zone_id": "17ce22c4db27214cd0ec8f490fe07404" }, "sensitive_attributes": [], diff --git a/ahoskingit/terraform/var_homeip.tfvar b/ahoskingit/terraform/var_homeip.tfvar deleted file mode 100644 index 98d0271..0000000 --- a/ahoskingit/terraform/var_homeip.tfvar +++ /dev/null @@ -1 +0,0 @@ -home_ip = "174.93.115.121" diff --git a/ahoskingit/terraform/variables.tf b/ahoskingit/terraform/variables.tf index 3bb8591..87abb85 100644 --- a/ahoskingit/terraform/variables.tf +++ b/ahoskingit/terraform/variables.tf @@ -19,6 +19,10 @@ variable "site5_ip" { default = "138.197.154.98" } +variable "do_assets" { +default = "165.22.228.138" +} + ## KFA IP variable "kfa_ip" { default = "64.137.159.107"