Files
ansible_dns/tasks/main.yml

18 lines
649 B
YAML

---
# tasks file for tco.dns
- name: manage dns record
vars:
state: "{{ (dns_action == 'delete' ) | ternary( 'absent', 'present' ) }}"
ansible714.ovh.dns:
ovh_api_endpoint: "{{ ovh_api_endpoint }}"
ovh_api_application_key: "{{ ovh_api_application_key }}"
ovh_api_application_secret: "{{ ovh_api_application_secret }}"
ovh_api_consumer_key: "{{ ovh_api_consumer_key }}"
zone: "{{ dns_zone }}"
record_name: "{{ item.record_name | ansible.builtin.regex_replace( '.'+dns_zone, '' ) }}"
record_value: "{{ item.record_value }}"
record_type: "{{ item.record_type }}"
state: "{{ state }}"
loop: "{{ dns_records }}"