mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
use alternate hosts file for dnsmasq
This commit is contained in:
parent
a2c79f9a31
commit
084f2a0328
4 changed files with 21 additions and 5 deletions
|
@ -54,6 +54,12 @@
|
||||||
dest: /etc/dnsmasq.d/iiab.conf
|
dest: /etc/dnsmasq.d/iiab.conf
|
||||||
when: dnsmasq_install and dnsmasq_enabled and (iiab_network_mode != "Appliance")
|
when: dnsmasq_install and dnsmasq_enabled and (iiab_network_mode != "Appliance")
|
||||||
|
|
||||||
|
- name: Install /etc/hosts.dnsmasq from template, sourced by /etc/dnsmasq.d/iiab.conf
|
||||||
|
template:
|
||||||
|
src: network/hosts-dnsmasq.j2
|
||||||
|
dest: /etc/hosts.dnsmasq
|
||||||
|
when: dnsmasq_install and dnsmasq_enabled and (iiab_network_mode != "Appliance")
|
||||||
|
|
||||||
## Another way to skin the cat
|
## Another way to skin the cat
|
||||||
##- name: Check if systemd service networkd-dispatcher is enabled
|
##- name: Check if systemd service networkd-dispatcher is enabled
|
||||||
## systemd:
|
## systemd:
|
||||||
|
|
|
@ -49,11 +49,11 @@
|
||||||
# when: 'iiab_wan_iface != "none" and wan_ip != "dhcp"'
|
# when: 'iiab_wan_iface != "none" and wan_ip != "dhcp"'
|
||||||
##### End static ip address info
|
##### End static ip address info
|
||||||
|
|
||||||
- include_tasks: hosts.yml
|
#- include_tasks: hosts.yml
|
||||||
tags:
|
# tags:
|
||||||
- network
|
# - network
|
||||||
- hostname
|
# - hostname
|
||||||
- domain
|
# - domain
|
||||||
|
|
||||||
- name: Configure wondershaper
|
- name: Configure wondershaper
|
||||||
include_tasks: wondershaper.yml
|
include_tasks: wondershaper.yml
|
||||||
|
|
|
@ -12,6 +12,13 @@ address=/#/{{ lan_ip }}
|
||||||
interface={{ iiab_lan_iface }}
|
interface={{ iiab_lan_iface }}
|
||||||
# Set the domain for dnsmasq
|
# Set the domain for dnsmasq
|
||||||
domain={{ iiab_domain }}
|
domain={{ iiab_domain }}
|
||||||
|
# don't use /etc/hosts
|
||||||
|
no-hosts
|
||||||
|
# instead use
|
||||||
|
addn-hosts=/etc/hosts.dnsmasq
|
||||||
|
# append 'local' to hostnames found
|
||||||
|
expand-hosts
|
||||||
|
|
||||||
# Specify the range of IP addresses the DHCP server will lease out to devices, and the duration of the lease
|
# Specify the range of IP addresses the DHCP server will lease out to devices, and the duration of the lease
|
||||||
dhcp-range=172.18.100.1,172.18.126.254,1h
|
dhcp-range=172.18.100.1,172.18.126.254,1h
|
||||||
# Specify the default route
|
# Specify the default route
|
||||||
|
|
3
roles/network/templates/network/hosts-dnsmasq.j2
Normal file
3
roles/network/templates/network/hosts-dnsmasq.j2
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
# Supplied by IIAB sourced by /etc/dnsmasq.d/iiab.conf
|
||||||
|
{{ iiab_hostname }} {{ lan_ip }}
|
||||||
|
box {{ lan_ip }}
|
Loading…
Add table
Add a link
Reference in a new issue