Skip to content
Browse files

[debops.dnsmasq] Add 'lxc' host record if needed

When the LXC support is enabled in the 'debops.dnsmaq' role and there's
no DNS domain configured (standalone host), the 'lxc' subdomain and
corresponding 'lxcbr0' network interface cannot be resolved from the LXC
host itself due to lack of 'search' entries in the '/etc/resolv.conf'
file. To fix that, the 'debops.dnsmasq' role will create a static host
record that points to the 'lxcbr0' network interface.
  • Loading branch information...
drybjed committed Aug 10, 2019
1 parent 57b7419 commit d10bdcfbd3193f065ad8ebfbdc94756bd4e48c75
Showing with 16 additions and 0 deletions.
  1. +16 −0 ansible/roles/debops.dnsmasq/defaults/main.yml
@@ -412,6 +412,22 @@ dnsmasq__default_configuration:
else "") }}'

# Create a separate 'lxc' host record that points to the 'lxcbr0'
# interface from the outside, if there's no external domain set.
- name: 'host-record'
value: '{{ (ansible_local.lxc.net_domain
if (ansible_local|d() and ansible_local.lxc|d() and
else "")
+ "," + (ansible_local.lxc.net_address
if (ansible_local|d() and ansible_local.lxc|d() and
else "") }}'
state: '{{ "present"
if (ansible_local|d() and ansible_local.lxc|d() and
"." not in ansible_local.lxc.net_domain|d())
else "absent" }}'

- name: 'rev-server'
value: '{{ (ansible_local.lxc.net_subnet
if (ansible_local|d() and ansible_local.lxc|d() and

0 comments on commit d10bdcf

Please sign in to comment.
You can’t perform that action at this time.