|
|
@ -1,6 +1,6 @@
|
|
|
|
---
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
- name: Store changes in dns entries locally
|
|
|
|
- name: Store changes in dns entries on the remote
|
|
|
|
copy:
|
|
|
|
copy:
|
|
|
|
content: |
|
|
|
|
content: |
|
|
|
|
#jinja2:trim_blocks: False
|
|
|
|
#jinja2:trim_blocks: False
|
|
|
@ -15,20 +15,19 @@
|
|
|
|
{% if not entry|regex_search('^(update )?(add|del(ete)?) ') %}update add {% endif %}{{ entry }}
|
|
|
|
{% if not entry|regex_search('^(update )?(add|del(ete)?) ') %}update add {% endif %}{{ entry }}
|
|
|
|
{% endif %}{% endfor %}
|
|
|
|
{% endif %}{% endfor %}
|
|
|
|
send
|
|
|
|
send
|
|
|
|
dest: "{{ local_file }}"
|
|
|
|
dest: "{{ entries_file }}"
|
|
|
|
owner: "{{ global_local_user }}"
|
|
|
|
owner: "{{ global_local_user }}"
|
|
|
|
group: "{{ global_local_user }}"
|
|
|
|
group: "{{ global_local_user }}"
|
|
|
|
mode: u=rw,g=r,o=r
|
|
|
|
mode: u=rw,g=r,o=r
|
|
|
|
delegate_to: localhost
|
|
|
|
delegate_to: "{{ dns_system_domain }}"
|
|
|
|
register: entries_changes_file
|
|
|
|
register: entries_changes_file
|
|
|
|
tags:
|
|
|
|
tags:
|
|
|
|
- dns_entries
|
|
|
|
- dns_entries
|
|
|
|
|
|
|
|
|
|
|
|
- name: Update dns entries at dns host
|
|
|
|
- name: Update dns entries at dns host
|
|
|
|
command:
|
|
|
|
make:
|
|
|
|
cmd: nsupdate -l # local mode
|
|
|
|
chdir: "{{ global_dns_changes_directory }}"
|
|
|
|
stdin: "{{ lookup('file', local_file) }}\n"
|
|
|
|
target: "{{ entries_file | basename }}~DONE"
|
|
|
|
delegate_to: "{{ dns_system_domain }}"
|
|
|
|
delegate_to: "{{ dns_system_domain }}"
|
|
|
|
when: entries_changes_file.changed and not ansible_check_mode
|
|
|
|
|
|
|
|
tags:
|
|
|
|
tags:
|
|
|
|
- dns_entries
|
|
|
|
- dns_entries
|
|
|
|