openstack-ansible-lxc_hosts/templates/lxc-net-bridge.cfg.j2
Jean-Philippe Evrard 513244b56b Added to ability to set mtu for lxcbr0
The lxc_host role overrides the configuration
done by the system administrator on the host.

If mtu was defined in /etc/lxc/ and in the
system network interfaces, then these configurations
will be overriden.

This commit should allow the deployer to set the
mtu for its lxcbr0 network, by setting the variable
lxc_net_mtu.

Fixes-Bug: #1518303

Change-Id: I42ab3d0a2c20ae94335de195cdb14579d9f59f5f
2015-12-02 17:13:24 +01:00

29 lines
926 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_nat == "true" %}
{% if lxc_net_gateway != "none" %}
gateway {{ lxc_net_gateway }}
{% endif %}
{% if lxc_net_mtu is defined %}
mtu {{ lxc_net_mtu }}
{% endif %}
# nat rules start and stop
post-up /usr/local/bin/lxc-system-manage iptables-create
post-down /usr/local/bin/lxc-system-manage iptables-remove
{% endif %}
# dnsmasq start and stop
post-up /usr/local/bin/lxc-system-manage dnsmasq-start || true
post-up /usr/local/bin/lxc-system-manage iptables-create
post-down /usr/local/bin/lxc-system-manage dnsmasq-stop
post-down /usr/local/bin/lxc-system-manage iptables-remove
bridge_fd 0
bridge_maxwait 0
bridge_ports {{ lxc_net_bridge_port }}
bridge_hello 2
bridge_maxage 12
bridge_stp off