Merge branch 'list'
This commit is contained in:
21
README.md
21
README.md
@@ -1,4 +1,4 @@
|
||||
Role Name
|
||||
Rôles Name
|
||||
=========
|
||||
|
||||
Add or remove dns records
|
||||
@@ -16,9 +16,10 @@ ovh_api_application_key
|
||||
ovh_api_application_secret
|
||||
ovh_api_consumer_key
|
||||
|
||||
record_name
|
||||
record_value
|
||||
record_type
|
||||
dns_records:
|
||||
- record_name
|
||||
record_value
|
||||
record_type
|
||||
dns_action: delete or add
|
||||
|
||||
Dependencies
|
||||
@@ -29,9 +30,17 @@ 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:
|
||||
|
||||
- hosts: localhost
|
||||
- hosts: localhost
|
||||
vars:
|
||||
dns_records:
|
||||
- record_name: foobar.opendoor.fr
|
||||
record_value: 1.2.3.4
|
||||
record_type: "A"
|
||||
- record_name: plop.opendoor.fr
|
||||
record_value: foobar.opendoor.fr.
|
||||
record__type: CNAME
|
||||
roles:
|
||||
- { role: tco.dns, record_name: "foobar.opendoor.fr", record_value: "1.2.3.43, record_type: 'A', dns_action: 'add' }
|
||||
- { role: tco.dns, dns_records: {{ dns_records }}" }
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
# tasks file for tco.dns
|
||||
|
||||
- name: manage dns record
|
||||
vars:
|
||||
state: "{{ (dns_action == 'delete' ) | ternary( 'absent', 'present' ) }}"
|
||||
@@ -9,8 +10,8 @@
|
||||
ovh_api_application_secret: "{{ ovh_api_application_secret }}"
|
||||
ovh_api_consumer_key: "{{ ovh_api_consumer_key }}"
|
||||
zone: "{{ dns_zone }}"
|
||||
record_name: "{{ record_name }}"
|
||||
record_value: "{{ record_value }}"
|
||||
record_type: "{{ record_type }}"
|
||||
record_name: "{{ item.record_name }}"
|
||||
record_value: "{{ item.record_value }}"
|
||||
record_type: "{{ item.record_type }}"
|
||||
state: "{{ state }}"
|
||||
|
||||
loop: "{{ dns_records }}"
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
- hosts: localhost
|
||||
vars:
|
||||
records:
|
||||
- record_name: test1
|
||||
record_value: 1.2.3.4
|
||||
record_type: "A"
|
||||
- record_name: test2
|
||||
record_value: foobar.opendoor.fr.
|
||||
record_type: CNAME
|
||||
roles:
|
||||
- role: tco.dns
|
||||
vars:
|
||||
record_name: test1
|
||||
record_value: 1.2.3.4
|
||||
record_type: "A"
|
||||
- { role: tco.dns, dns_action: "delete", dns_records: "{{ records }}" }
|
||||
|
||||
Reference in New Issue
Block a user