From e4b2ebb979d427ea1c6b895f41c214bd1ca93bb3 Mon Sep 17 00:00:00 2001 From: Khue Doan Date: Tue, 31 Aug 2021 02:12:03 +0700 Subject: [PATCH] Remove tfstate role --- metal/main.yml | 6 ------ metal/roles/tfstate/defaults/main.yml | 1 - metal/roles/tfstate/tasks/main.yml | 11 ----------- metal/roles/tfstate/templates/backend.tfvars.j2 | 5 ----- 4 files changed, 23 deletions(-) delete mode 100644 metal/roles/tfstate/defaults/main.yml delete mode 100644 metal/roles/tfstate/tasks/main.yml delete mode 100644 metal/roles/tfstate/templates/backend.tfvars.j2 diff --git a/metal/main.yml b/metal/main.yml index 956bb25c..4bc6a240 100644 --- a/metal/main.yml +++ b/metal/main.yml @@ -8,9 +8,3 @@ gather_facts: no roles: - wake - -- name: Create Terraform state storage - hosts: metal[0] - gather_facts: no - roles: - - tfstate diff --git a/metal/roles/tfstate/defaults/main.yml b/metal/roles/tfstate/defaults/main.yml deleted file mode 100644 index a8f43f12..00000000 --- a/metal/roles/tfstate/defaults/main.yml +++ /dev/null @@ -1 +0,0 @@ -etcd_port: 23799 diff --git a/metal/roles/tfstate/tasks/main.yml b/metal/roles/tfstate/tasks/main.yml deleted file mode 100644 index 122e9149..00000000 --- a/metal/roles/tfstate/tasks/main.yml +++ /dev/null @@ -1,11 +0,0 @@ -- name: Wait for etcd - wait_for: - port: 23799 - host: '{{ ansible_ssh_host }}' - connection: local - -- name: Generate Terraform backend config - delegate_to: localhost - template: - src: backend.tfvars.j2 - dest: "{{ playbook_dir }}/../cluster/backend.tfvars" diff --git a/metal/roles/tfstate/templates/backend.tfvars.j2 b/metal/roles/tfstate/templates/backend.tfvars.j2 deleted file mode 100644 index 4a285b08..00000000 --- a/metal/roles/tfstate/templates/backend.tfvars.j2 +++ /dev/null @@ -1,5 +0,0 @@ -endpoints = [ -{% for host in ansible_play_hosts %} - "{{ hostvars[host].ansible_host }}:{{ etcd_port }}", -{% endfor %} -]