P-Q upgrade fails due to change in inventory

Bug #1741462 reported by Jean-Philippe Evrard
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack-Ansible
Fix Released
Critical
Jean-Philippe Evrard

Bug Description

Here is an extract of my log:

    xenial: System is bootstrapped and ready for use.
    xenial: + echo 'System is bootstrapped and ready for use.'
    xenial: /opt/openstack-ansible/playbooks /opt/openstack-ansible
    xenial: basename ${file_part} .yml
    xenial: openstack-ansible /opt/openstack-ansible/scripts/upgrade-utilities/playbooks/ansible_fact_cleanup.yml
    xenial: Variable files: "-e @/etc/openstack_deploy/user_secrets.yml -e @/etc/openstack_deploy/user_variables.yml "
    xenial: [WARNING]: Unable to parse /opt/openstack-ansible/playbooks/inventory as an
    xenial: inventory source
    xenial: [WARNING]: No inventory was parsed, only implicit localhost is available
    xenial: [WARNING]: Could not match supplied host pattern, ignoring: all
    xenial: [WARNING]: provided hosts list is empty, only localhost is available

Re-running it outside my vagrant environment works, which proves there are variables still hanging around in the process, even after: https://review.openstack.org/#/c/531123/

Revision history for this message
Jean-Philippe Evrard (jean-philippe-evrard) wrote :

As you can see, the folder is /opt/openstack-ansible/playbooks/inventory instead of the current /opt/openstack-ansible/inventory.

The wrapper rc file is correct:
export ANSIBLE_INVENTORY="${ANSIBLE_INVENTORY:-/opt/openstack-ansible/inventory/dynamic_inventory.py,/etc/openstack_deploy/inventory.ini}"

Changed in openstack-ansible:
assignee: nobody → Jean-Philippe Evrard (jean-philippe-evrard)
status: New → In Progress
Revision history for this message
Jean-Philippe Evrard (jean-philippe-evrard) wrote :

Modifying patch 531123 (to remove the ANSIBLE_INVENTORY variable definition) opened a new series of issues namely:

    xenial: [WARNING]: * Failed to parse /opt/openstack-
    xenial: ansible/inventory/dynamic_inventory.py with script plugin: Inventory script
    xenial: (/opt/openstack-ansible/inventory/dynamic_inventory.py) had an execution error:
    xenial: Traceback (most recent call last): File "/opt/openstack-
    xenial: ansible/inventory/dynamic_inventory.py", line 80, in <module> output =
    xenial: generate.main(**all_args) File "/opt/openstack-
    xenial: ansible/osa_toolkit/generate.py", line 1134, in main user_defined_config
    xenial: File "/opt/openstack-ansible/osa_toolkit/generate.py", line 740, in
    xenial: container_skel_load address_prefix=p_net.get('address_prefix') File
    xenial: "/opt/openstack-ansible/osa_toolkit/generate.py", line 576, in
    xenial: _add_additional_networks address_prefix File "/opt/openstack-
    xenial: ansible/osa_toolkit/generate.py", line 576, in _add_additional_networks
    xenial: address_prefix File "/opt/openstack-ansible/osa_toolkit/generate.py", line
    xenial: 646, in _add_additional_networks phg = user_config[cphg][container_host]
    xenial: KeyError: 'aio1_neutron_agents_container-a551b468'
    xenial: [WARNING]: * Failed to parse /opt/openstack-
    xenial: ansible/inventory/dynamic_inventory.py with ini plugin: /opt/openstack-
    xenial: ansible/inventory/dynamic_inventory.py:18: Expected key=value host variable
    xenial: assignment, got: argparse
    xenial: [WARNING]: Unable to parse /opt/openstack-
    xenial: ansible/inventory/dynamic_inventory.py as an inventory source
    xenial: [WARNING]: Unable to parse /etc/openstack_deploy/inventory.ini as an inventory
    xenial: source
    xenial: [WARNING]: No inventory was parsed, only implicit localhost is available
    xenial: [WARNING]: Could not match supplied host pattern, ignoring: all
    xenial: [WARNING]: provided hosts list is empty, only localhost is available

Revision history for this message
Jean-Philippe Evrard (jean-philippe-evrard) wrote :
Revision history for this message
Jean-Philippe Evrard (jean-philippe-evrard) wrote :

Loading the dynamic inventory manually gives me the following:

  File "/opt/openstack-ansible/osa_toolkit/generate.py", line x, in _add_additional_networks
    phg = user_config[cphg][container_host]
KeyError: 'aio1_neutron_agents_container-a551b468'

Needs further investigation to see if it's related to the hyper converged work.

Changed in openstack-ansible:
status: In Progress → New
Changed in openstack-ansible:
assignee: Jean-Philippe Evrard (jean-philippe-evrard) → nobody
Changed in openstack-ansible:
status: New → Confirmed
importance: Undecided → Critical
Changed in openstack-ansible:
assignee: nobody → Jean-Philippe Evrard (jean-philippe-evrard)
status: Confirmed → In Progress
Changed in openstack-ansible:
assignee: Jean-Philippe Evrard (jean-philippe-evrard) → Kevin Carter (kevin-carter)
Changed in openstack-ansible:
assignee: Kevin Carter (kevin-carter) → Jean-Philippe Evrard (jean-philippe-evrard)
Changed in openstack-ansible:
assignee: Jean-Philippe Evrard (jean-philippe-evrard) → Kevin Carter (kevin-carter)
Changed in openstack-ansible:
assignee: Kevin Carter (kevin-carter) → Jean-Philippe Evrard (jean-philippe-evrard)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible (master)

Reviewed: https://review.openstack.org/531123
Committed: https://git.openstack.org/cgit/openstack/openstack-ansible/commit/?id=81e1f8d173d663e5f7f6a385e89359c3e9d75a54
Submitter: Zuul
Branch: master

commit 81e1f8d173d663e5f7f6a385e89359c3e9d75a54
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
      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_INVENTORY.
    - Ensuring all containers are using the repo that was build
      during the upgrade.

    Change-Id: I0fd3a8803bf345ccad07dc97968e104cd0a7bf70
    Partial-Bug: #1741462
    Closes-Bug: #1675810

Changed in openstack-ansible:
status: In Progress → Fix Committed
Mohammed Naser (mnaser)
Changed in openstack-ansible:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.