diff --git a/configure-route53.yml b/configure-route53.yml index 7b2b699..543dea1 100644 --- a/configure-route53.yml +++ b/configure-route53.yml @@ -15,7 +15,6 @@ ttl: 60 value: "{{ item.dest }}" wait: true - overwrite: true loop: - domain: "{{ hostvars['servicesnode']['hostname'] }}" dest: "{{ hostvars['servicesnode']['ansible_host'] }}" @@ -51,13 +50,10 @@ record: "{{ item.domain }}.data.nesi.org.nz" type: A ttl: 60 - value: "{{ item.dest }}" wait: true loop: - - domain: "{{ hostvars['servicesnode']['hostname'] }}" - dest: "{{ hostvars['servicesnode']['ansible_host'] }}" - - domain: "{{ hostvars['webnode']['hostname'] }}" - dest: "{{ hostvars['webnode']['ansible_host'] }}" + - domain: "{{ terraform_workspace }}-ood-services" + - domain: "{{ terraform_workspace }}-ood-webnode" when: (operation == "destroy") ignore_errors: true diff --git a/deployment.sh b/deployment.sh index 7e113b2..8aed3b2 100755 --- a/deployment.sh +++ b/deployment.sh @@ -2,10 +2,10 @@ case $1 in "destroy") - # ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i host.ini destroy-k8s-cluster.yml \ - # -u ${TF_VAR_vm_user} --key-file '${TF_VAR_key_file}' -e operation=destroy -e terraform_workspace=${2:-default} || true - # ansible-playbook -i host.ini configure-route53.yml -e operation=destroy -e terraform_workspace=${2:-default} - # ansible-playbook setup-infra.yml -e operation=destroy -e terraform_workspace=${2:-default} + ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i host.ini destroy-k8s-cluster.yml \ + -u ${TF_VAR_vm_user} --key-file '${TF_VAR_key_file}' -e operation=destroy -e terraform_workspace=${2:-default} || true + ansible-playbook configure-route53.yml -e operation=destroy -e terraform_workspace=${2:-default} + ansible-playbook setup-infra.yml -e operation=destroy -e terraform_workspace=${2:-default} ;; "create") ansible-playbook setup-infra.yml -e operation=create -e terraform_workspace=${2:-default}