-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* First ddns approach * Add a condition to skip nsupdate when not needed * set TTL to 600 * Repair NS entries if they don't match AWS' * Add retries with random delay to route53 task * Add env variable for ddns TTL --------- Co-authored-by: Guillaume Coré <gucore@redhat.com>
- Loading branch information
1 parent
ba947f6
commit c029557
Showing
17 changed files
with
155 additions
and
20 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
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
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
- tags: | ||
- nuke | ||
- ddns | ||
when: operation in ['CREATE','RESET'] or nuke_sandbox | bool | ||
block: | ||
- name: Fetch all NS records for this sandbox | ||
shell: >- | ||
set -o pipefail; | ||
host -t ns -W 60 -R 10 {{ account_name }}.{{ ddns_domain }} | ||
| awk '{ print $4 }' | ||
register: _recordfind | ||
ignore_errors: true | ||
changed_when: false | ||
|
||
- when: _recordfind is succeeded | ||
set_fact: | ||
ddns_ns_records: "{{ _recordfind.stdout.split('\n') }}" | ||
|
||
- when: _recordfind is failed | ||
set_fact: | ||
ddns_ns_records: "" | ||
|
||
- name: Override NS records to DDNS | ||
when: ddns_ns_records | sort != ns_records | sort | ||
community.general.nsupdate: | ||
state: present | ||
server: "{{ lookup('dig', ddns_server) }}" | ||
key_name: "{{ ddns_key_name }}" | ||
key_algorithm: "{{ ddns_key_algorithm | d('hmac-sha512') }}" | ||
key_secret: "{{ ddns_key_secret }}" | ||
port: "{{ ddns_port | d('53') }}" | ||
type: NS | ||
ttl: "{{ ddns_ttl | default(600, true) }}" | ||
zone: "{{ ddns_domain }}." | ||
record: "{{ account_name }}.{{ ddns_domain }}." | ||
value: "{{ ns_records }}" |
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