forked from cerc-io/testnet-ops
73 lines
2.3 KiB
YAML
73 lines
2.3 KiB
YAML
|
- name: Configure DNS records
|
||
|
hosts: localhost
|
||
|
|
||
|
vars_files:
|
||
|
- vars/dns-vars.yml
|
||
|
|
||
|
tasks:
|
||
|
- name: Create a domain
|
||
|
community.digitalocean.digital_ocean_domain:
|
||
|
state: present
|
||
|
oauth_token: "{{ do_api_token }}"
|
||
|
name: "{{ full_domain }}"
|
||
|
ip: "{{ service_provider_ip }}"
|
||
|
|
||
|
- name: Create record for cluster control machine
|
||
|
community.digitalocean.digital_ocean_domain_record:
|
||
|
state: present
|
||
|
oauth_token: "{{ do_api_token }}"
|
||
|
domain: "{{ full_domain }}"
|
||
|
type: A
|
||
|
name: "{{ subdomain_prefix }}-cluster-control"
|
||
|
data: "{{ service_provider_ip }}"
|
||
|
|
||
|
- name: Create CNAME record for www
|
||
|
community.digitalocean.digital_ocean_domain_record:
|
||
|
state: present
|
||
|
oauth_token: "{{ do_api_token }}"
|
||
|
data: "{{ full_domain }}"
|
||
|
domain: "{{ full_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 }}.{{ full_domain }}"
|
||
|
domain: "{{ full_domain }}"
|
||
|
type: CNAME
|
||
|
name: "{{ subdomain_prefix }}"
|
||
|
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 }}.{{ full_domain }}"
|
||
|
domain: "{{ full_domain }}"
|
||
|
type: CNAME
|
||
|
name: "*.{{ subdomain_prefix }}"
|
||
|
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 }}.{{ full_domain }}"
|
||
|
domain: "{{ full_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 }}.{{ full_domain }}"
|
||
|
domain: "{{ full_domain }}"
|
||
|
type: CNAME
|
||
|
name: "*.pwa"
|
||
|
ttl: 43200
|