diff --git a/docs/getting_started/clean-up.rst b/docs/getting_started/clean-up.rst index 5488f2ab..e6eea8a7 100644 --- a/docs/getting_started/clean-up.rst +++ b/docs/getting_started/clean-up.rst @@ -8,3 +8,9 @@ To release the resources, please run:: terraform destroy ```` can be "openstack", "gce" or "aws". + +To delete the Clouflare DNS records, please run:: + + ansible-playbook playbooks/clean-cloudflare.yml + +**Warning:** if you create a new cluster before deleting the DNS records, the Ansible inventory will be replaced and you will have to delete the records manually. diff --git a/playbooks/clean-cloudflare.yml b/playbooks/clean-cloudflare.yml new file mode 100644 index 00000000..cbf36cb3 --- /dev/null +++ b/playbooks/clean-cloudflare.yml @@ -0,0 +1,6 @@ +- hosts: edge + gather_facts: False + vars: + cf_state: "absent" + roles: + - { role: ../stacks/traefik-lb/roles/cloudflare } diff --git a/stacks/traefik-lb/roles/cloudflare/tasks/main.yml b/stacks/traefik-lb/roles/cloudflare/tasks/main.yml index 329e8c36..12640701 100644 --- a/stacks/traefik-lb/roles/cloudflare/tasks/main.yml +++ b/stacks/traefik-lb/roles/cloudflare/tasks/main.yml @@ -23,6 +23,6 @@ record: "{{ cf_record }}" type: A value: "{{ ansible_ssh_host }}" - state: "present" + state: "{{ cf_state | default('present') }}" account_email: "{{ cf_mail }}" account_api_token: "{{ cf_token }}"