Add ansible playbook to automate service provider setup #10
1
service-provider-setup/README.md
Normal file
1
service-provider-setup/README.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
# service-provider-setup
|
5
service-provider-setup/dns-vars.example.yml
Normal file
5
service-provider-setup/dns-vars.example.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
domain: ""
|
||||||
|
subdomain: ""
|
||||||
|
subdomain_cluster_control: "{{ subdomain }}-cluster-control"
|
||||||
|
cluster_control_ip: ""
|
||||||
|
do_api_token: ""
|
5
service-provider-setup/dns-vars.yml
Normal file
5
service-provider-setup/dns-vars.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
domain: "test.wireitin.com"
|
||||||
|
subdomain: "dss-ind"
|
||||||
|
subdomain_cluster_control: "{{ subdomain }}-cluster-control"
|
||||||
|
cluster_control_ip: "64.227.134.44"
|
||||||
|
do_api_token: ""
|
72
service-provider-setup/setup-dns.yml
Normal file
72
service-provider-setup/setup-dns.yml
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
- name: Configure DNS records
|
||||||
|
hosts: localhost
|
||||||
|
gather_facts: no
|
||||||
|
vars_files:
|
||||||
|
- dns-vars.yml
|
||||||
|
|
||||||
|
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
|
||||||
|
name: "{{ subdomain }}-cluster-control"
|
||||||
|
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
|
||||||
|
name: "{{ subdomain }}"
|
||||||
|
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
|
||||||
|
name: "*.{{ subdomain }}"
|
||||||
|
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
|
Loading…
Reference in New Issue
Block a user