-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed issue-86 - added support for cloudflare api token
- Loading branch information
Showing
13 changed files
with
157 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -182,7 +182,7 @@ Please configure in `cluster.yml` all necessary credentials: | |
| DNS provider | Variables | | ||
|---|---| | ||
|Azure|`azure_client_id: 'client_id'`<br/>`azure_secret: 'key'`<br/>`azure_subscription_id: 'subscription_id'`<br/>`azure_tenant: 'tenant_id'`<br/>`azure_resource_group: 'dns_zone_resource_group'` | | ||
|CloudFlare|`cloudflare_account_email: [email protected]` <br> Use the global api key here! (API-Token is not supported!) (Details in #86) <br>`cloudflare_account_api_token: 9348234sdsd894.....` <br> `cloudflare_zone: domain.tld`| | ||
|CloudFlare|`cloudflare_zone: domain.tld`<br>api key via <br>`cloudflare_account_api_token:`<br>Or global api key **not recommended** <br>`cloudflare_account_email: [email protected]`<br>`cloudflare_account_api_token: 9348.....`| | ||
|DigitalOcean|`digitalocean_token: e7a6f82c3245b65cf4.....` <br> `digitalocean_zone: domain.tld`| | ||
|Gandi|`gandi_account_api_token: 0123456...` <br> `gandi_zone: domain.tld`| | ||
|GCP|`gcp_project: project-name `<br/>`gcp_managed_zone_name: 'zone-name'`<br/>`gcp_managed_zone_domain: 'example.com.'`<br/>`gcp_serviceaccount_file: ../gcp_service_account.json` | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,11 +12,12 @@ Requirements | |
Role Variables | ||
-------------- | ||
|
||
| variable | describtion | example | default | | ||
| variable | describtion | example | default | | ||
|---|---|---|---| | ||
| le_dns_provider | DNS provider | `[route53|cloudflare|gcp|azure|hetzner]` | non **required** | | ||
| le_cloudflare_account_email | Cloudflare Account E-Mail for API authentication | `[email protected]`| non **required if provider is cloudflare** | | ||
| le_cloudflare_account_api_token | Cloudflare API token for API authentication | `loo...ngiJ`| non **required if provider is cloudflare** | | ||
| le_cloudflare_account_api_token | Cloudflare Global API token for API authentication | `loo...ngiJ`| non **required if provider is cloudflare** | | ||
| le_cloudflare_api_token | Cloudflare API token for API authentication | `loo...ngiJ`| non **required if provider is cloudflare** | | ||
| le_cloudflare_zone | Cloudflare zone in which the entries are created and deleted for the dns challenge | `domain.tld` | non **required if provider is cloudflare** | | ||
| le_aws_access_key | AWS Access key | | non **required if provider is route53** | | ||
| le_aws_secret_key | AWS secret key || non **required if provider is route53** | | ||
|
@@ -71,7 +72,7 @@ Example in context of hetzner-ocp4 | |
lc_cloudflare_account_email: "{{ cloudflare_account_email }}" | ||
lc_cloudflare_account_api_token: "{{ cloudflare_account_api_token }}" | ||
lc_cloudflare_zone: "{{ cloudflare_zone }}" | ||
lc_public_domain: "{{ cluster_name }}.{{ public_domain }}" | ||
lc_public_domain: "{{ cluster_name }}.{{ public_domain }}" | ||
# Only set if you really want a production letsencrypt certificate | ||
# https://letsencrypt.org/docs/rate-limits/ | ||
# lc_acme_directory: "https://acme-v02.api.letsencrypt.org/directory" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
- name: Create DNS record at CloudFlare via account_api_token | ||
delegate_to: localhost | ||
community.general.net_tools.cloudflare_dns: | ||
zone: "{{ le_cloudflare_zone }}" | ||
record: "{{ item.0.key }}" | ||
# 1 for automatic | ||
ttl: 1 | ||
type: TXT | ||
value: "{{ item.1 }}" | ||
account_email: "{{ le_cloudflare_account_email }}" | ||
account_api_token: "{{ le_cloudflare_account_api_token }}" | ||
register: record | ||
loop: "{{ challenge_data_dns | default({}) | dict2items | subelements('value') }}" | ||
when: | ||
- le_dns_provider == "cloudflare" | ||
- le_cloudflare_account_email is defined | ||
- le_cloudflare_account_api_token is defined | ||
- sample_com_challenge is changed | ||
|
||
- name: Create DNS record at CloudFlare via api_token | ||
delegate_to: localhost | ||
community.general.net_tools.cloudflare_dns: | ||
zone: "{{ le_cloudflare_zone }}" | ||
record: "{{ item.0.key }}" | ||
# 1 for automatic | ||
ttl: 1 | ||
type: TXT | ||
value: "{{ item.1 }}" | ||
api_token: "{{ le_cloudflare_api_token }}" | ||
register: record | ||
loop: "{{ challenge_data_dns | default({}) | dict2items | subelements('value') }}" | ||
when: | ||
- le_dns_provider == "cloudflare" | ||
- le_cloudflare_api_token is defined | ||
- sample_com_challenge is changed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
- name: Delete DNS record at CloudFlare via account_api_token | ||
delegate_to: localhost | ||
community.general.net_tools.cloudflare_dns: | ||
zone: "{{ le_cloudflare_zone }}" | ||
record: "{{ item.0.key }}" | ||
# 1 for automatic | ||
ttl: 1 | ||
type: TXT | ||
value: "{{ item.1 }}" | ||
account_email: "{{ le_cloudflare_account_email }}" | ||
account_api_token: "{{ le_cloudflare_account_api_token }}" | ||
state: absent | ||
loop: "{{ challenge_data_dns | default({}) | dict2items | subelements('value') }}" | ||
when: | ||
- le_dns_provider == "cloudflare" | ||
- le_cloudflare_account_email is defined | ||
- le_cloudflare_account_api_token is defined | ||
- sample_com_challenge is changed | ||
|
||
- name: Delete DNS record at CloudFlare via api_token | ||
delegate_to: localhost | ||
community.general.net_tools.cloudflare_dns: | ||
zone: "{{ le_cloudflare_zone }}" | ||
record: "{{ item.0.key }}" | ||
# 1 for automatic | ||
ttl: 1 | ||
type: TXT | ||
value: "{{ item.1 }}" | ||
api_token: "{{ le_cloudflare_api_token }}" | ||
state: absent | ||
loop: "{{ challenge_data_dns | default({}) | dict2items | subelements('value') }}" | ||
when: | ||
- le_dns_provider == "cloudflare" | ||
- le_cloudflare_api_token is defined | ||
- sample_com_challenge is changed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,8 +14,11 @@ letsencrypt_account_email: [email protected] | |
# Depending on the dns provider: | ||
# CloudFlare | ||
cloudflare_account_email: [email protected] | ||
# Use the global api key! - (API-Token is not supported!) (Details in #86) | ||
# Uansible/roles/openshift-4-cluster/tasks/prepare-host-RedHat-entitlement.ymlse the global api key! - (API-Token is not supported!) (Details in #86) | ||
# Global Account API token - not recommend | ||
cloudflare_account_api_token: 9348234sdsd894..... | ||
# API token | ||
cloudflare_api_token: ..... | ||
cloudflare_zone: example.com | ||
# Route53 | ||
aws_access_key: key | ||
|