inventory overrides causing dynamic_inventory.py to stacktrace
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack-Ansible |
Fix Released
|
Medium
|
Jean-Philippe Evrard |
Bug Description
When overriding the property "is_metal" within the user defined env.d files I've found that the inventory generator raises an error indicating it's encountered a "KeyError" when adding addresses to a given container.
``` traceback
Traceback (most recent call last):
File "./inventory/
output = generate.
File "/opt/openstack
user_
File "/opt/openstack
static_
File "/opt/openstack
static_routes
File "/opt/openstack
static_routes
File "/opt/openstack
phg = user_config[
KeyError: u'aio1_
```
This is an example env.d file defined as nova.yml within the /etc/openstack_
``` yaml
container_skel:
nova_
properties:
is_metal: true
nova_
properties:
is_metal: true
nova_
properties:
is_metal: true
nova_
properties:
is_metal: true
nova_
properties:
is_metal: true
nova_
properties:
is_metal: true
nova_
properties:
is_metal: true
```
The debug log for the inventory generation process can be found here: http://
----
The desired outcome would be to have the inventory generator allow me to flip the bit on the "is_metal" property leaving the existing containers untouched. This would allow a deployer to change the deployment strategy within a given release without having to first destroy the existing containers and remove their entries from inventory.
Changed in openstack-ansible: | |
status: | New → Confirmed |
assignee: | nobody → Kevin Carter (kevin-carter) |
Changed in openstack-ansible: | |
status: | Confirmed → In Progress |
Changed in openstack-ansible: | |
assignee: | Kevin Carter (kevin-carter) → Jean-Philippe Evrard (jean-philippe-evrard) |
Reviewed: https:/ /review. openstack. org/531123 /git.openstack. org/cgit/ openstack/ openstack- ansible/ commit/ ?id=81e1f8d173d 663e5f7f6a385e8 9359c3e9d75a54
Committed: https:/
Submitter: Zuul
Branch: master
commit 81e1f8d173d663e 5f7f6a385e89359 c3e9d75a54
Author: Jean-Philippe Evrard <email address hidden>
Date: Thu Jan 4 10:43:26 2018 +0000
Include P-Q changes into the upgrade script
We need to include changes in the upgrade script to handle
the changes done during the Queens timeframe:
- Inventory is fixed to prevent a stacktrace if a container INVENTORY.
default was moved from is_metal: False to is_metal: True,
and now respects existing container properties.
- Ensuring previous inventory location isn't overriding the
Queens inventory location in memory, by unsetting
ANSIBLE_
- Ensuring all containers are using the repo that was build
during the upgrade.
Change-Id: I0fd3a8803bf345 ccad07dc97968e1 04cd0a7bf70
Partial-Bug: #1741462
Closes-Bug: #1675810