Create DNS entry.
This commit is contained in:
parent
b3646b9df2
commit
9648366e8b
@ -126,3 +126,24 @@
|
||||
immediate: true
|
||||
state: enabled
|
||||
become: true
|
||||
|
||||
- name: Create DNS entry
|
||||
ansible.builtin.lineinfile:
|
||||
path: "/var/lib/docker-latest/volumes/dockernamed_var_bind/_data/named.scimetis.net"
|
||||
regexp: '^{{ SHORTNAME }}\s*IN'
|
||||
line: "{{ SHORTNAME }} IN A {{ ansible_host }}"
|
||||
register: dns_entry
|
||||
become: true
|
||||
vars:
|
||||
ansible_ssh_port: "{{ SECRET_SSH_PORT }}"
|
||||
remote_user: "{{ LINUX_USERNAME }}"
|
||||
delegate_to: "{{ SECRET_HOST }}"
|
||||
|
||||
- name: Restart DNS container on SECRET_HOST
|
||||
command: docker exec -it named /usr/sbin/rndc reload
|
||||
become: true
|
||||
vars:
|
||||
ansible_ssh_port: "{{ SECRET_SSH_PORT }}"
|
||||
remote_user: "{{ LINUX_USERNAME }}"
|
||||
delegate_to: "{{ SECRET_HOST }}"
|
||||
when: dns_entry is changed
|
||||
|
@ -1,4 +1,5 @@
|
||||
---
|
||||
SHORTNAME: "{{ target_name.split('.')[0] }}"
|
||||
DOMAIN: "{{ target_name[target_name.index('.') + 1:] }}"
|
||||
|
||||
OS_IMAGE: Rocky Linux 9
|
||||
|
Loading…
Reference in New Issue
Block a user