Skip to content

Commit

Permalink
Add CNAME mechanism for rui
Browse files Browse the repository at this point in the history
  • Loading branch information
cradle8810 committed Oct 30, 2024
1 parent 4e689dd commit f0b29d0
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions inventories/host_vars/rui/CNAME.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
cname:
- name: jenkins-deb.hayaworld.home
real: dockerservice.hayaworld.home
1 change: 1 addition & 0 deletions rui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 9 additions & 0 deletions tasks/rui/dnsmasq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions templates/rui/etc/dnsmasq.d/cname.conf.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% for item in cname %}
cname={{ item.name }},{{ item.real }}
{% endfor %}

0 comments on commit f0b29d0

Please sign in to comment.