Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1903349

Summary: python_cmd undefined when configuring the overcloud with Ansible
Product: Red Hat OpenStack Reporter: Mircea Vutcovici <mircea.vutcovici>
Component: openstack-tripleo-heat-templatesAssignee: Alex Schultz <aschultz>
Status: CLOSED ERRATA QA Contact: Joe H. Rahme <jhakimra>
Severity: low Docs Contact:
Priority: low    
Version: 16.1 (Train)CC: aschultz, drosenfe, mburns, slinaber
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: openstack-tripleo-heat-templates-11.3.2-1.20210319163528.29a02c1.el8ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-26 13:49:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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