refactor: restructure inventory, split roles and add new services
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
---
|
||||
- name: ensure /etc/dnsmasq.d exists
|
||||
ansible.builtin.file:
|
||||
path: /etc/dnsmasq.d
|
||||
state: directory
|
||||
mode: "0755"
|
||||
|
||||
- name: deploy dnsmasq rule
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item }}"
|
||||
dest: "/etc/dnsmasq.d/{{ item }}"
|
||||
mode: "0644"
|
||||
loop:
|
||||
- 10-upstream.conf
|
||||
- 20-custom-domains.conf
|
||||
- 20-dhcp.conf
|
||||
- 20-dns-optimizations.conf
|
||||
notify: restart dnsmasq
|
||||
|
||||
- name: render local
|
||||
ansible.builtin.template:
|
||||
src: 90-local.conf.j2
|
||||
dest: /etc/dnsmasq.d/90-local.conf
|
||||
mode: "0644"
|
||||
notify: restart dnsmasq
|
||||
|
||||
- name: render dhcp-host
|
||||
ansible.builtin.template:
|
||||
src: 90-dhcp-host.conf.j2
|
||||
dest: /etc/dnsmasq.d/90-dhcp-host.conf
|
||||
mode: "0644"
|
||||
notify: restart dnsmasq
|
||||
|
||||
- name: render domain
|
||||
ansible.builtin.template:
|
||||
src: 90-domains.conf.j2
|
||||
dest: /etc/dnsmasq.d/90-domains.conf
|
||||
mode: "0644"
|
||||
notify: restart dnsmasq
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
- name: install dnsmasq
|
||||
ansible.builtin.apt:
|
||||
name: dnsmasq
|
||||
state: latest
|
||||
update_cache: true
|
||||
@@ -1,39 +1,6 @@
|
||||
---
|
||||
- name: ensure /etc/dnsmasq.d exists
|
||||
ansible.builtin.file:
|
||||
path: /etc/dnsmasq.d
|
||||
state: directory
|
||||
mode: "0755"
|
||||
- name: include dnsmasq install
|
||||
ansible.builtin.include_tasks: install.yml
|
||||
|
||||
- name: deploy dnsmasq rule
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item }}"
|
||||
dest: "/etc/dnsmasq.d/{{ item }}"
|
||||
mode: "0644"
|
||||
loop:
|
||||
- 10-upstream.conf
|
||||
- 20-custom-domains.conf
|
||||
- 20-dhcp.conf
|
||||
- 20-dns-optimizations.conf
|
||||
notify: restart dnsmasq
|
||||
|
||||
- name: render local
|
||||
ansible.builtin.template:
|
||||
src: 90-local.conf.j2
|
||||
dest: /etc/dnsmasq.d/90-local.conf
|
||||
mode: "0644"
|
||||
notify: restart dnsmasq
|
||||
|
||||
- name: render dhcp-host
|
||||
ansible.builtin.template:
|
||||
src: 90-dhcp-host.conf.j2
|
||||
dest: /etc/dnsmasq.d/90-dhcp-host.conf
|
||||
mode: "0644"
|
||||
notify: restart dnsmasq
|
||||
|
||||
- name: render domain
|
||||
ansible.builtin.template:
|
||||
src: 90-domains.conf.j2
|
||||
dest: /etc/dnsmasq.d/90-domains.conf
|
||||
mode: "0644"
|
||||
notify: restart dnsmasq
|
||||
- name: include dnsmasq configurure
|
||||
ansible.builtin.include_tasks: configure.yml
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#jinja2: trim_blocks: True, lstrip_blocks: True
|
||||
{% for item in groups[dnsmasq_managed_group] | sort %}
|
||||
{% for item in dnsmasq_managed_group | sort %}
|
||||
{% set client = hostvars[item] %}
|
||||
{% set ip = client.container_ip | default(client.ansible_host | default(none)) %}
|
||||
{% if client['dhcp-host'] is defined and client['dhcp-host'] and ip %}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#jinja2: trim_blocks: True, lstrip_blocks: True
|
||||
{% for item in groups[dnsmasq_managed_group] | sort %}
|
||||
{% for item in dnsmasq_managed_group | sort %}
|
||||
{% set client = hostvars[item] %}
|
||||
{% if 'dnsmasq' in client and client.dnsmasq %}
|
||||
{% set default_ip = client.container_ip | default(client.ansible_host | default(none)) %}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#jinja2: trim_blocks: True, lstrip_blocks: True
|
||||
{% for item in groups[dnsmasq_managed_group] | sort %}
|
||||
{% for item in dnsmasq_managed_group | sort %}
|
||||
{% set client = hostvars[item] %}
|
||||
{% set ip = client.container_ip | default(client.ansible_host | default(none)) %}
|
||||
{% if ip %}
|
||||
|
||||
Reference in New Issue
Block a user