Bug 1903349 - python_cmd undefined when configuring the overcloud with Ansible
Summary: python_cmd undefined when configuring the overcloud with Ansible
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-tripleo-heat-templates
Version: 16.1 (Train)
Hardware: x86_64
OS: Linux
low
low
Target Milestone: ---
: ---
Assignee: Alex Schultz
QA Contact: Joe H. Rahme
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-12-01 20:58 UTC by Mircea Vutcovici
Modified: 2024-10-01 17:09 UTC (History)
4 users (show)

Fixed In Version: openstack-tripleo-heat-templates-11.3.2-1.20210319163528.29a02c1.el8ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-05-26 13:49:37 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1907858 0 None None None 2020-12-11 20:35:19 UTC
OpenStack gerrit 766788 0 None NEW [Ussuri and older] Set python_cmd where we need it 2021-01-27 16:23:31 UTC
OpenStack gerrit 779365 0 None NEW [Ussuri and older] Set python_cmd where we need it 2021-03-08 21:03:03 UTC
Red Hat Issue Tracker OSP-1863 0 None None None 2022-08-30 11:54:58 UTC
Red Hat Product Errata RHBA-2021:2097 0 None None None 2021-05-26 13:50:16 UTC

Description Mircea Vutcovici 2020-12-01 20:58:41 UTC
Description of problem:
When we deploy with this procedure [a], and when we resume from step4 (and probably any steps > 1), python_cmd is undefined.

The variable python_cmd is taken from step1 [1]

We worked around by running this:
    openstack tripleo config generate ansible --deployment-user stack --output-dir /var/lib/mistral/overcloud

This generates an ansible.cfg with the fact cache enabled.

We also had to add [1] into the step4 playbook to define the fact that we were missing.

It's the only cacheable fact we were able to find across all non update/upgrade playbooks.

The ansible.cfg is generated here [b] but we couldn't catch where it's run yet.


[a] https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/16.1/html/director_installation_and_usage/configuring-the-overcloud-with-ansible#separating-the-provisioning-and-configuration-processes


[b] https://github.com/openstack/tripleo-common/blob/stable/train/tripleo_common/actions/ansible.py
[1]
~~~
        - name: set python_cmd
          set_fact:
            python_cmd: "python{{ ansible_python.version.major }}"
            cacheable: true
          when: python_cmd is not defined
          tags:
            - container_config_tasks
~~~


Version-Release number of selected component (if applicable):


How reproducible:
all the time

Comment 1 Alex Schultz 2020-12-11 20:16:58 UTC
If you are running it manually and doing so mid-deploy, run ansible-playbook with -e python_cmd=python3.  The issue is that you don't run the task that sets python_cmd fact when you --start-from-tasks or skip specific things.  We could probably copy the set fact to be used closer to where it's actually consumed in the code to alleviate this, but it's a minor thing to pass the var at execution time.

Comment 13 errata-xmlrpc 2021-05-26 13:49:37 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Red Hat OpenStack Platform 16.1.6 bug fix and enhancement advisory), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:2097


Note You need to log in before you can comment on or make changes to this bug.