openstack-ansible-lxc_hosts/templates/lxc-net-bridge.cfg.j2
Ravi Kumar Boyapati fff13e53d7 Add lxc_net_manage_iptables variable
Added lxc_net_manage_iptables variable. Setting this variable avoids
duplcaiting the existing rules.

Change-Id: I76800d23929bd2a6f656a20095b7d2352a4757fa
2017-03-23 16:43:20 -04:00

30 lines
874 B
Django/Jinja

# {{ ansible_managed }}
auto {{ lxc_net_bridge }}
iface {{ lxc_net_bridge }} inet static
address {{ lxc_net_address }}
netmask {{ lxc_net_netmask }}
{% if lxc_net_gateway is not none %}
gateway {{ lxc_net_gateway }}
{% endif %}
{% if lxc_net_mtu is defined %}
mtu {{ lxc_net_mtu }}
{% endif %}
{% if lxc_net_nat | bool %}
# dnsmasq start and stop
{% if lxc_net_manage_iptables | bool %}
post-up /usr/local/bin/lxc-system-manage iptables-create
{% endif %}
post-up /usr/local/bin/lxc-system-manage dnsmasq-start || true
{% if lxc_net_manage_iptables | bool %}
post-down /usr/local/bin/lxc-system-manage iptables-remove
{% endif %}
post-down /usr/local/bin/lxc-system-manage dnsmasq-stop
{% endif %}
bridge_fd 0
bridge_maxwait 0
bridge_ports {{ lxc_net_bridge_port }}
bridge_hello 2
bridge_maxage 12
bridge_stp off