Merge "Always create containers with fixed MAC addresses"

This commit is contained in:
Zuul 2018-03-07 00:07:39 +00:00 committed by Gerrit Code Review
commit f89140f478
5 changed files with 5 additions and 18 deletions

View File

@ -154,9 +154,6 @@ lxc_container_networks:
interface: eth0
type: veth
# Enable fixed mac address generation for an lxc container
lxc_container_fixed_mac: false
# Enable destroying then recreating containers
lxc_container_recreate: false

View File

@ -0,0 +1,5 @@
---
deprecations:
- |
The `lxc_container_fixed_mac` option has been removed and containers will
be created with static mac addresses.

View File

@ -102,8 +102,6 @@
mode: "0755"
delegate_to: "{{ physical_host }}"
with_dict: "{{ lxc_container_networks_combined }}"
when:
- lxc_container_fixed_mac | bool
- name: Set define static mac address from an existing interface
command: "/openstack/{{ inventory_hostname }}/{{ item.value.interface }}_mac_generation.sh"
@ -111,8 +109,6 @@
creates: "/var/lib/lxc/{{ inventory_hostname }}/{{ item.value.interface }}.hwaddr"
delegate_to: "{{ physical_host }}"
with_dict: "{{ lxc_container_networks_combined }}"
when:
- lxc_container_fixed_mac | bool
- name: Gather hardware addresses to be used as facts
slurp:
@ -121,8 +117,6 @@
register: macs
with_dict: "{{ lxc_container_networks_combined }}"
delegate_to: "{{ physical_host }}"
when:
- lxc_container_fixed_mac | bool
# NOTE(cloudnull): To dynamically set the the mac address "facts" Ansible line
# format is being used
@ -130,8 +124,6 @@
set_fact: "{{item.item.value.interface }}_mac_address={{ item.content | b64decode }}"
with_items:
- "{{ macs.results }}"
when:
- lxc_container_fixed_mac | bool
- name: LXC host config for container networks
template:

View File

@ -13,11 +13,7 @@ lxc.network.veth.pair = {{ lxc_container_network_veth_pair[-15:] }}
# Host link to attach to, this should be a bridge if lxc.network.type = veth
lxc.network.link = {{ item.value.bridge }}
# Hardware Address
{% if lxc_container_fixed_mac | bool %}
lxc.network.hwaddr = {{ hostvars[inventory_hostname][item.value.interface + '_mac_address'] }}
{% else %}
lxc.network.hwaddr = 00:16:3e:xx:xx:xx
{% endif %}
# enable the device on boot
lxc.network.flags = up
# Set the container network MTU

View File

@ -5,6 +5,3 @@ ansible_user: root
lxc_container_config_list:
# The unconfined profile is causing problems with overlayfs. See https://bugs.launchpad.net/openstack-ansible/+bug/1612412
- "lxc.aa_profile={{ (lxc_container_backing_store == 'overlayfs') | ternary('lxc-openstack', 'unconfined') }}"
# TEST FOR FIXED MAC ADDRESS
lxc_container_fixed_mac: true