You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hetzner-ansible/roles/_digitalocean/tasks/domain.yml

27 lines
670 B
YAML

---
- name: Create DNS entry for <{{ record_name }}> if necessary
uri:
method: POST
url: "https://api.digitalocean.com/v2/domains/{{ domain }}/records"
headers:
authorization: Bearer {{ digitalocean_authentication_token }}
body: '{{ create_record | to_json }}'
body_format: json
return_content: yes
status_code: 201
vars:
create_record:
type: 'A'
ttl: 1800
data: "{{ record_data }}"
name: "{{ record_name }}"
when:
domain_record.ip == '-'
or record_data != domain_record.ip
or record_name != domain_record.name
delegate_to: 127.0.0.1
become: false
tags:
- update_dns