This repository was archived by the owner on Sep 7, 2022. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,17 +4,10 @@ name: Release
44# This release workflow requires the following environment variables:
55# - galaxy_api_key (API key for Ansible Galaxy)
66
7- # disable GH action for template
8- # remove and uncommment below "on" block when using in production
97on :
108 push :
11- branches-ignore :
12- - ' **'
13-
14- # on:
15- # push:
16- # branches:
17- # - master
9+ branches :
10+ - master
1811
1912jobs :
2013 release :
Original file line number Diff line number Diff line change 8181 wait_for_ssh : 1
8282 env :
8383 API_TOKEN : ${{ secrets.HETZNER_TOKEN }}
84- - uses : getstackhead/stackhead/actions/integration-test@feature/dns-support
84+ - uses : getstackhead/stackhead/actions/integration-test@next
8585 with :
8686 ipaddress : ${{ steps.setup_server.outputs.hcloud_server_created_ipv4 }}
8787 domain : ' ${{ env.DOMAIN_NAME }}.${{ env.DOMAIN_SUFFIX }}'
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ StackHead module for Cloudflare DNS.
44
55## Installation
66
7+ ### Ansible
8+
79Install it via ` ansible-galaxy ` :
810
911```
2729 # ...
2830```
2931
30-
3132## Configuration
3233
33- Make sure to provide the API token for Cloudflare via StackHead CLI configuration file.
34+ ### API Token
3435
35- You can generate an API token [ in your Cloudflare profile] ( https://dash.cloudflare.com/profile/api-tokens ) .
36+ Make sure to provide the API token for Cloudflare. You can generate an API token [ in your Cloudflare profile] ( https://dash.cloudflare.com/profile/api-tokens ) .
3637Make sure to grant ` write ` permissions to DNS on Zone level.
3738
3839``` yaml
@@ -50,6 +51,8 @@ stackhead__config_deployment:
5051 cloudflare_api_token : MY-API-TOKEN
5152` ` `
5253
54+ ### Domain setting
55+
5356You'll also have to define the DNS provider to be used for each domain you want to set up in project definition:
5457
5558` ` ` yaml
Original file line number Diff line number Diff line change 11---
2+ constraints :
3+ - stackhead>=1.3.0
24type : dns
Original file line number Diff line number Diff line change 55 that :
66 - module.config.cloudflare_api_token|d("") != ""
77- name : " Create A record for domain {{ item.domain }}"
8- cloudflare_dns :
9- zone : " {{ item.domain|getstackhead.stackhead.domain }}"
10- record : " {{ item.domain|getstackhead.stackhead.subdomain|d('@', true) }}"
11- type : A
12- value : " {{ ansible_ssh_host }}"
13- api_token : " {{ module.config.cloudflare_api_token }}"
14- proxied : no
15- solo : yes
8+ include_tasks : " {{ module_role_path | default(role_path) }}/tasks/steps/records/a.yml"
9+ vars :
10+ domain : " {{ item.domain }}"
1611 state : present
17- when : item.dns.provider|d('') == 'cloudflare '
12+ when : item.dns.provider|d('') == 'getstackhead.stackhead_dns_cloudflare '
1813 with_items : " {{ app_config.domains }}" # item.domain
Original file line number Diff line number Diff line change 55 that :
66 - module.config.cloudflare_api_token|d("") != ""
77- name : " Remove A record for domain {{ item.domain }}"
8- cloudflare_dns :
9- zone : " {{ item.domain|getstackhead.stackhead.domain }}"
10- record : " {{ item.domain|getstackhead.stackhead.subdomain|d('@', true) }}"
11- type : A
12- value : " {{ ansible_ssh_host }}"
13- api_token : " {{ module.config.cloudflare_api_token }}"
8+ include_tasks : " {{ module_role_path | default(role_path) }}/tasks/steps/records/a.yml"
9+ vars :
10+ domain : " {{ item.domain }}"
1411 state : absent
15- when : item.dns.provider|d('') == 'cloudflare '
12+ when : item.dns.provider|d('') == 'getstackhead.stackhead_dns_cloudflare '
1613 with_items : " {{ app_config.domains }}" # item.domain
Original file line number Diff line number Diff line change 1+ # required vars:
2+ # - domain
3+ # - state
4+ # optional vars:
5+ # - proxied
6+ # - solo
7+ ---
8+ - cloudflare_dns :
9+ zone : " {{ domain|getstackhead.stackhead.domain }}"
10+ record : " {{ domain|getstackhead.stackhead.subdomain|d('@', true) }}"
11+ type : A
12+ value : " {{ ansible_ssh_host }}"
13+ api_token : " {{ module.config.cloudflare_api_token }}"
14+ proxied : " {{ proxied|d(false) }}"
15+ solo : " {{ solo|d(true) }}"
16+ state : present
17+ when : state == 'present'
18+ - cloudflare_dns :
19+ zone : " {{ domain|getstackhead.stackhead.domain }}"
20+ record : " {{ domain|getstackhead.stackhead.subdomain|d('@', true) }}"
21+ type : A
22+ value : " {{ ansible_ssh_host }}"
23+ api_token : " {{ module.config.cloudflare_api_token }}"
24+ proxied : " {{ proxied|d(false) }}"
25+ state : " {{ state }}"
26+ when : state != 'present'
Original file line number Diff line number Diff line change 1+ # required vars:
2+ # - domain
3+ # - state
4+ # optional vars:
5+ # - proxied
6+ # - solo
7+ ---
8+ - cloudflare_dns :
9+ zone : " {{ domain|getstackhead.stackhead.domain }}"
10+ record : " {{ domain|getstackhead.stackhead.subdomain|d('@', true) }}"
11+ type : AAAA
12+ value : " {{ ansible_ssh_host }}"
13+ api_token : " {{ module.config.cloudflare_api_token }}"
14+ proxied : " {{ proxied|d(false) }}"
15+ solo : " {{ solo|d(true) }}"
16+ state : present
17+ when : state == 'present'
18+ - cloudflare_dns :
19+ zone : " {{ domain|getstackhead.stackhead.domain }}"
20+ record : " {{ domain|getstackhead.stackhead.subdomain|d('@', true) }}"
21+ type : AAAA
22+ value : " {{ ansible_ssh_host }}"
23+ api_token : " {{ module.config.cloudflare_api_token }}"
24+ proxied : " {{ proxied|d(false) }}"
25+ state : " {{ state }}"
26+ when : state != 'present'
Original file line number Diff line number Diff line change 1+ # required vars:
2+ # - domain
3+ # - value
4+ # - state
5+ # optional vars:
6+ # - proxied
7+ # - solo
8+ ---
9+ - cloudflare_dns :
10+ zone : " {{ domain|getstackhead.stackhead.domain }}"
11+ record : " {{ domain|getstackhead.stackhead.subdomain|d('@', true) }}"
12+ type : CNAME
13+ value : " {{ value }}"
14+ api_token : " {{ module.config.cloudflare_api_token }}"
15+ proxied : " {{ proxied|d(false) }}"
16+ solo : " {{ solo|d(true) }}"
17+ state : present
18+ when : state == 'present'
19+ - cloudflare_dns :
20+ zone : " {{ domain|getstackhead.stackhead.domain }}"
21+ record : " {{ domain|getstackhead.stackhead.subdomain|d('@', true) }}"
22+ type : CNAME
23+ value : " {{ value }}"
24+ api_token : " {{ module.config.cloudflare_api_token }}"
25+ proxied : " {{ proxied|d(false) }}"
26+ state : " {{ state }}"
27+ when : state != 'present'
Original file line number Diff line number Diff line change 1+ # required vars:
2+ # - domain
3+ # - value
4+ # - state
5+ # optional vars:
6+ # - proxied
7+ # - solo
8+ ---
9+ - cloudflare_dns :
10+ zone : " {{ domain|getstackhead.stackhead.domain }}"
11+ record : " {{ domain|getstackhead.stackhead.subdomain|d('@', true) }}"
12+ type : MX
13+ priority : 1
14+ value : " {{ value }}"
15+ api_token : " {{ module.config.cloudflare_api_token }}"
16+ proxied : " {{ proxied|d(false) }}"
17+ solo : " {{ solo|d(true) }}"
18+ state : present
19+ when : state == 'present'
20+ - cloudflare_dns :
21+ zone : " {{ domain|getstackhead.stackhead.domain }}"
22+ record : " {{ domain|getstackhead.stackhead.subdomain|d('@', true) }}"
23+ type : MX
24+ priority : 1
25+ value : " {{ value }}"
26+ api_token : " {{ module.config.cloudflare_api_token }}"
27+ proxied : " {{ proxied|d(false) }}"
28+ state : " {{ state }}"
29+ when : state != 'present'
You can’t perform that action at this time.
0 commit comments