openstack-ansible-lxc_conta.../templates/macs.fact.j2
Nolan Brubaker e311cb657e Write MAC addresses to local facts folder
This change allows for caching of the MAC addresses between runs by
using local facts on the physical host. This saves calculation time
after the first run, since the facts are effectively cached.

This also means any containers that rely on having stable MAC addresses
(such as neutron agents or rabbitmq) can be recreated with the same MAC
address if the container is destroyed. It will *not* be retained if
destroyed and removed from inventory, however, since the facts rely on
using the exact same hostname.

Change-Id: Id3d13299c1416cc4862437629b32f4309c2dc595
2017-06-29 10:10:07 +00:00

5 lines
120 B
Django/Jinja

[{{ inventory_hostname }}]
{% for mac in macs.results %}
{{ mac.item.value.interface }} = {{ mac.stdout }}
{% endfor %}