diff --git a/inventories/host_vars/rui/CNAME.yml b/inventories/host_vars/rui/CNAME.yml new file mode 100644 index 0000000..51a4865 --- /dev/null +++ b/inventories/host_vars/rui/CNAME.yml @@ -0,0 +1,4 @@ +--- +cname: + - name: jenkins-deb.hayaworld.home + real: dockerservice.hayaworld.home diff --git a/rui.yml b/rui.yml index 3555a88..8fc2f57 100644 --- a/rui.yml +++ b/rui.yml @@ -7,6 +7,7 @@ vars_files: - inventories/host_vars/rui/NXDOMAIN.yml + - inventories/host_vars/rui/CNAME.yml - inventories/host_vars/rui.yml - inventories/host_vars/networks.yml diff --git a/tasks/rui/dnsmasq.yml b/tasks/rui/dnsmasq.yml index 5107ed6..5ad240e 100644 --- a/tasks/rui/dnsmasq.yml +++ b/tasks/rui/dnsmasq.yml @@ -26,6 +26,15 @@ mode: '0644' notify: "Restart dnsmasq" +- name: Add CNAME config + ansible.builtin.template: + src: templates/rui/etc/dnsmasq.d/cname.conf.j2 + dest: /etc/dnsmasq.d/cname.conf.j2 + owner: root + group: root + mode: '0644' + notify: "Restart dnsmasq" + - name: Add hosts(5) ansible.builtin.template: src: templates/rui/etc/hosts.j2 diff --git a/templates/rui/etc/dnsmasq.d/cname.conf.j2 b/templates/rui/etc/dnsmasq.d/cname.conf.j2 new file mode 100644 index 0000000..057eb8e --- /dev/null +++ b/templates/rui/etc/dnsmasq.d/cname.conf.j2 @@ -0,0 +1,3 @@ +{% for item in cname %} +cname={{ item.name }},{{ item.real }} +{% endfor %}