testnet-ops/service-provider-setup/setup-dns.yml

73 lines
2.2 KiB
YAML
Raw Normal View History

2024-09-18 07:48:48 +00:00
- name: Configure DNS records
hosts: localhost
2024-09-18 10:08:38 +00:00
2024-09-18 07:48:48 +00:00
vars_files:
2024-09-23 09:08:49 +00:00
- vars/dns-vars.yml
2024-09-18 07:48:48 +00:00
tasks:
- name: Create a domain
community.digitalocean.digital_ocean_domain:
state: present
oauth_token: "{{ do_api_token }}"
name: "{{ domain }}"
ip: "{{ cluster_control_ip }}"
- name: Create record for cluster control machine
community.digitalocean.digital_ocean_domain_record:
state: present
oauth_token: "{{ do_api_token }}"
domain: "{{ domain }}"
type: A
2024-09-23 13:29:16 +00:00
name: "{{ subdomain_prefix }}-cluster-control"
2024-09-18 07:48:48 +00:00
data: "{{ cluster_control_ip }}"
- name: Create CNAME record for www
community.digitalocean.digital_ocean_domain_record:
state: present
oauth_token: "{{ do_api_token }}"
data: "{{ domain }}"
domain: "{{ domain }}"
type: CNAME
name: www
ttl: 43200
- name: Create CNAME record for subdomain
community.digitalocean.digital_ocean_domain_record:
state: present
oauth_token: "{{ do_api_token }}"
data: "{{ subdomain_cluster_control }}.{{ domain }}"
domain: "{{ domain }}"
type: CNAME
2024-09-23 13:29:16 +00:00
name: "{{ subdomain_prefix }}"
2024-09-18 07:48:48 +00:00
ttl: 43200
- name: Create wildcard CNAME record for subdomain
community.digitalocean.digital_ocean_domain_record:
state: present
oauth_token: "{{ do_api_token }}"
data: "{{ subdomain_cluster_control }}.{{ domain }}"
domain: "{{ domain }}"
type: CNAME
2024-09-23 13:29:16 +00:00
name: "*.{{ subdomain_prefix }}"
2024-09-18 07:48:48 +00:00
ttl: 43200
- name: Create CNAME record for pwa
community.digitalocean.digital_ocean_domain_record:
state: present
oauth_token: "{{ do_api_token }}"
data: "{{ subdomain_cluster_control }}.{{ domain }}"
domain: "{{ domain }}"
type: CNAME
name: "pwa"
ttl: 43200
- name: Create wildcard CNAME record for pwa
community.digitalocean.digital_ocean_domain_record:
state: present
oauth_token: "{{ do_api_token }}"
data: "{{ subdomain_cluster_control }}.{{ domain }}"
domain: "{{ domain }}"
type: CNAME
name: "*.pwa"
ttl: 43200