125 lines
4.0 KiB
YAML
125 lines
4.0 KiB
YAML
- name: Configure DNS records
|
|
hosts: localhost
|
|
|
|
vars_files:
|
|
- vars/dns-vars.yml
|
|
- vars/k8s-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 record for daemon machine
|
|
community.digitalocean.digital_ocean_domain_record:
|
|
state: present
|
|
oauth_token: "{{ do_api_token }}"
|
|
domain: "{{ full_domain }}"
|
|
type: A
|
|
name: "{{ org_id }}-daemon"
|
|
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 }}.{{ full_domain }}"
|
|
ttl: 43200
|
|
|
|
- name: Create CNAME record for laconicd endpoint
|
|
community.digitalocean.digital_ocean_domain_record:
|
|
state: present
|
|
oauth_token: "{{ do_api_token }}"
|
|
data: "{{ org_id }}-daemon.{{ full_domain }}"
|
|
domain: "{{ full_domain }}"
|
|
type: CNAME
|
|
name: "laconicd.{{ full_domain }}"
|
|
ttl: 43200
|
|
|
|
- name: Create CNAME record for backend
|
|
community.digitalocean.digital_ocean_domain_record:
|
|
state: present
|
|
oauth_token: "{{ do_api_token }}"
|
|
data: "{{ org_id }}-daemon.{{ full_domain }}"
|
|
domain: "{{ full_domain }}"
|
|
type: CNAME
|
|
name: "{{ org_id }}-backend.{{ full_domain }}"
|
|
ttl: 43200
|
|
|
|
- name: Create CNAME record for console
|
|
community.digitalocean.digital_ocean_domain_record:
|
|
state: present
|
|
oauth_token: "{{ do_api_token }}"
|
|
data: "{{ org_id }}-daemon.{{ full_domain }}"
|
|
domain: "{{ full_domain }}"
|
|
type: CNAME
|
|
name: "{{ org_id }}-console.{{ full_domain }}"
|
|
ttl: 43200
|
|
|
|
- name: Create CNAME record for org and location
|
|
community.digitalocean.digital_ocean_domain_record:
|
|
state: present
|
|
oauth_token: "{{ do_api_token }}"
|
|
data: "{{ org_id }}-daemon.{{ full_domain }}"
|
|
domain: "{{ full_domain }}"
|
|
type: CNAME
|
|
name: "{{ subdomain_prefix }}"
|
|
ttl: 43200
|
|
|
|
- name: Create wildcard A record for subdomain
|
|
community.digitalocean.digital_ocean_domain_record:
|
|
state: present
|
|
oauth_token: "{{ do_api_token }}"
|
|
name: "{{ subdomain_cluster_control }}.{{ full_domain }}"
|
|
data: "{{ service_provider_ip }}"
|
|
domain: "{{ full_domain }}"
|
|
type: A
|
|
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 A record for pwa
|
|
community.digitalocean.digital_ocean_domain_record:
|
|
state: present
|
|
oauth_token: "{{ do_api_token }}"
|
|
name: "{{ subdomain_cluster_control }}.{{ full_domain }}"
|
|
data: "{{ service_provider_ip }}"
|
|
domain: "{{ full_domain }}"
|
|
type: A
|
|
name: "*.pwa"
|
|
ttl: 43200
|