Files
home-cluster/bootstrap/tasks/validation/cloudflare.yaml
T
Devin Buhl 1ec59d1559 feat: add advanced features to config (#1208)
* feat: add advanced features to config

Signed-off-by: Devin Buhl <devin@buhl.casa>

* fix: only enable longhorn if distro is k3s or k0s

Signed-off-by: Devin Buhl <devin@buhl.casa>

* fix: update ansible lint

Signed-off-by: Devin Buhl <devin@buhl.casa>

---------

Signed-off-by: Devin Buhl <devin@buhl.casa>
2024-01-20 12:27:20 -05:00

39 lines
1.4 KiB
YAML

---
- name: Query Cloudflare zone
when: not ci_test|default(false)
ansible.builtin.uri:
url: https://api.cloudflare.com/client/v4/zones?name={{ bootstrap_cloudflare_domain }}&status=active
headers:
Authorization: Bearer {{ bootstrap_cloudflare_token }}
Content-Type: application/json
timeout: 5
return_content: true
body_format: json
register: result
- name: Check if Cloudflare zone exists
when: not ci_test|default(false)
ansible.builtin.assert:
that: result.json.success is true
success_msg: Cloudflare zone {{ bootstrap_cloudflare_domain }} exists
fail_msg: Cloudflare zone {{ bootstrap_cloudflare_domain }} does not exist
- name: Query Cloudflared tunnel
when: not ci_test|default(false)
ansible.builtin.uri:
url: https://api.cloudflare.com/client/v4/accounts/{{ bootstrap_cloudflare_account_tag }}/cfd_tunnel/{{ bootstrap_cloudflare_tunnel_id }}
headers:
Authorization: Bearer {{ bootstrap_cloudflare_token }}
Content-Type: application/json
timeout: 5
return_content: true
body_format: json
register: result
- name: Check if Cloudflared tunnel exists
when: not ci_test|default(false)
ansible.builtin.assert:
that: result.json.success is true
success_msg: Cloudflared tunnel {{ bootstrap_cloudflare_tunnel_id }} exists
fail_msg: Cloudflared tunnel {{ bootstrap_cloudflare_tunnel_id }} does not exist