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 8989 webserver : ' ${{ env.WEBSERVER }}'
9090 container : ' ${{ env.CONTAINER }}'
9191 dns : ' ${{ env.DNS }}'
92- dns_cloudflare_email : ' ${{ secrets.CLOUDFLARE_EMAIL }}'
9392 dns_cloudflare_apitoken : ' ${{ secrets.CLOUDFLARE_TOKEN }}'
9493 rolename : ' ${{ env.ROLE_NAME }}'
9594 - name : Remove Hetzner server
Original file line number Diff line number Diff line change 3030
3131## Configuration
3232
33- Make sure to provide the email and API token for Cloudflare via StackHead CLI configuration file:
33+ Make sure to provide the API token for Cloudflare via StackHead CLI configuration file.
34+
35+ You can generate an API token [ in your Cloudflare profile] ( https://dash.cloudflare.com/profile/api-tokens ) .
36+ Make sure to grant ` write ` permissions to DNS on Zone level.
3437
3538``` yaml
3639config :
3740 deployment :
3841 getstackhead.stackhead_dns_cloudflare :
39- cloudflare_email : my@email.address
4042 cloudflare_api_token : MY-API-TOKEN
4143` ` `
4244
@@ -45,7 +47,6 @@ or Ansible inventory:
4547` ` ` yaml
4648stackhead__config_deployment :
4749 getstackhead.stackhead_dns_cloudflare :
48- cloudflare_email : my@email.address
4950 cloudflare_api_token : MY-API-TOKEN
5051` ` `
5152
Original file line number Diff line number Diff line change 33- name : Check Cloudflare credentials
44 assert :
55 that :
6- - module.config.cloudflare_email|d("") != ""
76 - module.config.cloudflare_api_token|d("") != ""
87- name : " Create A record for domain {{ item.domain }}"
98 cloudflare_dns :
109 zone : " {{ item.domain|getstackhead.stackhead.domain }}"
1110 record : " {{ item.domain|getstackhead.stackhead.subdomain|d('@', true) }}"
1211 type : A
1312 value : " {{ ansible_ssh_host }}"
14- account_email : " {{ module.config.cloudflare_email }}"
15- account_api_token : " {{ module.config.cloudflare_api_token }}"
13+ api_token : " {{ module.config.cloudflare_api_token }}"
1614 proxied : no
1715 solo : yes
1816 state : present
Original file line number Diff line number Diff line change 33- name : Check Cloudflare credentials
44 assert :
55 that :
6- - module.config.cloudflare_email|d("") != ""
76 - module.config.cloudflare_api_token|d("") != ""
87- name : " Remove A record for domain {{ item.domain }}"
98 cloudflare_dns :
109 zone : " {{ item.domain|getstackhead.stackhead.domain }}"
1110 record : " {{ item.domain|getstackhead.stackhead.subdomain|d('@', true) }}"
1211 type : A
1312 value : " {{ ansible_ssh_host }}"
14- account_email : " {{ module.config.cloudflare_email }}"
15- account_api_token : " {{ module.config.cloudflare_api_token }}"
13+ api_token : " {{ module.config.cloudflare_api_token }}"
1614 state : absent
1715 when : item.dns.provider|d('') == 'cloudflare'
1816 with_items : " {{ app_config.domains }}" # item.domain
You can’t perform that action at this time.
0 commit comments