Update container interface template to disable DHCP routes when gateway set

This patch updates the container interface template to disable DHCP routes,
including the default route thru eth0/lxcbr0, when a gateway address override
is set.

Change-Id: I3ec0b8ddc68fc30aff40e80face9e3a6b1ffd4bc
Partial-Bug: #1810319
Depends-On: https://review.openstack.org/629309
This commit is contained in:
James Denton 2019-01-08 20:48:01 +00:00
parent b15b97fa0a
commit 5a59d2bdd4
1 changed files with 4 additions and 0 deletions

View File

@ -10,6 +10,10 @@ Address={{ item.value.address }}/{{ addr_cidr }}
UseDNS={{ (lxc_container_enable_resolved | bool) | ternary('yes', 'no') }}
UseNTP=yes
RouteMetric=20
{% if hostvars[inventory_hostname]['gateway'] is defined %}
UseRoutes=False
{% endif %}
{% endif %}
{% for route in item.value.static_routes | default([]) %}