Compare commits

...

6 Commits

Author SHA1 Message Date
c3e41a3427 Merge branch 'master' of ssh://infra.opendoor.fr:2222/tom/ansible_dns 2024-07-17 10:03:47 +02:00
d7b1584b9f remove dep to changelog, as this role is played locally 2024-07-17 10:03:08 +02:00
e2835676ad fix readme 2024-04-23 11:36:47 +02:00
6d0c01eee7 fix readme 2024-04-23 11:31:59 +02:00
53ce83859e set dns_action as default add
remove api key and secret from defaults
2024-03-26 09:47:04 +01:00
461d255e6b add dep to tco.changelog 2023-10-12 16:10:30 +02:00
4 changed files with 11 additions and 35 deletions

View File

@@ -20,7 +20,7 @@ dns_records:
- record_name
record_value
record_type
dns_action: delete or add
dns_action: delete or add (default add)
Dependencies
------------
@@ -30,6 +30,8 @@ Example Playbook
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
```yaml
- hosts: localhost
vars:
dns_records:
@@ -40,7 +42,8 @@ Including an example of how to use your role (for instance, with variables passe
record_value: foobar.opendoor.fr.
record__type: CNAME
roles:
- { role: tco.dns, dns_records: {{ dns_records }}" }
- { role: tco.dns }
```
License
-------
@@ -50,4 +53,4 @@ BSD
Author Information
------------------
An optional section for the role authors to include contact information, or a website (HTML is not allowed).
Thomas C <thomas@opendoor.fr>

View File

@@ -1,32 +1,4 @@
---
# defaults file for tco.dns
#
dns_zone: opendoor.fr
ovh_api_endpoint: ovh-eu
ovh_api_application_key: !vault |
$ANSIBLE_VAULT;1.1;AES256
31373037653235353036313530363531353265643131383861323936383532613462653961363462
6639653636663332396466346335376261373166366530320a383863663337376233346161643665
34303361633862633765393865636132653935616663306534333963613162363364666231383262
3861616139623563620a636434363961626338306537623633633937666633393238373333393763
62613133396439653331666631326433633665646364366433386662386363626435
ovh_api_application_secret: !vault |
$ANSIBLE_VAULT;1.1;AES256
30366433363031396663656632626337393731616435663732303265356265363333356465346233
3035373061346430363062383164393133373562323733350a633633653632363236396432636432
37336365383834653033626535383139366465613566363364613363376431393230346131363066
3330323932333462370a643534626234653164396536376363666236643932376464626532396435
30333231373430393362666266316465333739623334353635633761653833666666373962653537
3965393137663932396163333062663865306433366538343138
ovh_api_consumer_key: !vault |
$ANSIBLE_VAULT;1.1;AES256
31386662353864346439616233303234356331396465643261346338393662306638616335613531
6337656265636533356234393232346139663439303231640a383032353563623636396235386265
32626237656331333362656236613062383338613834646535373163613864653965386362356263
6361653338656665640a373336366533386665346136396535636164313863386539393432623831
38336431316438343139316362343262313636663339313636353966613330623730326430663861
3365656335326532633534643237386534646436623034346462
dns_action: add

View File

@@ -47,6 +47,7 @@ galaxy_info:
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.
dependencies: []
dependencies:
#- { role: tco.changelog, myrole_name: ansible_dns }
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.

View File

@@ -10,7 +10,7 @@
ovh_api_application_secret: "{{ ovh_api_application_secret }}"
ovh_api_consumer_key: "{{ ovh_api_consumer_key }}"
zone: "{{ dns_zone }}"
record_name: "{{ item.record_name }}"
record_name: "{{ item.record_name | ansible.builtin.regex_replace( '.'+dns_zone, '' ) }}"
record_value: "{{ item.record_value }}"
record_type: "{{ item.record_type }}"
state: "{{ state }}"