openstack_service_setup_host referenced in hosts before it's defined

Bug #2031647 reported by Jonathan Herlin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack-Ansible
Fix Released
Undecided
Unassigned

Bug Description

Tested on 24.5.1 & 25.4.0

Playbook 1: https://github.com/openstack/openstack-ansible/blob/e3d3716b4e5c6af534001df7e22363baeca9abfa/playbooks/healthcheck-infrastructure.yml#L99-L106
Playbook 2: https://github.com/openstack/openstack-ansible/blob/e3d3716b4e5c6af534001df7e22363baeca9abfa/playbooks/ceph-rgw-keystone-setup.yml#L16-L24

When the hosts are being evaluated, by default "openstack_service_setup_host" is not defined and being evaluated back to the default of "localhost".
The playbook then loads vars from the "vars_file" and sets "openstack_service_setup_host" to the first utility container.

ansible_python_interpreter is then picking up the https://github.com/openstack/openstack-ansible/blob/e3d3716b4e5c6af534001df7e22363baeca9abfa/playbooks/defaults/source_install.yml#L31 as if we were running in the utility container, but we are really executing on localhost now which ends up failing the task as we don't have "/openstack/venvs/utility-{{ openstack_release }}/bin/python" on the OSA deployer VM.

A workaround is to uncomment the "openstack_service_setup_host" in the user_variables.yml so that it's always availabe when first evaluating the hosts to target.
https://github.com/openstack/openstack-ansible/blob/e3d3716b4e5c6af534001df7e22363baeca9abfa/etc/openstack_deploy/user_variables.yml#L33

description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible (master)
Changed in openstack-ansible:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible (master)

Reviewed: https://review.opendev.org/c/openstack/openstack-ansible/+/891697
Committed: https://opendev.org/openstack/openstack-ansible/commit/f05c90103cdc3e18ae8b100fb4f260d2809168d9
Submitter: "Zuul (22348)"
Branch: master

commit f05c90103cdc3e18ae8b100fb4f260d2809168d9
Author: Dmitriy Rabotyagov <email address hidden>
Date: Thu Aug 17 14:29:25 2023 +0200

    Define install_method default when hosts resolution depend on it

    In some playbooks we try to fetch openstack_service_setup_host based on
    install_method variable. However, if variable is not defined,
    and it is not by default, playbooks will run against localhost,
    which will result in failure.

    Closes-Bug: #2031647
    Change-Id: I247ce2a808076ff55347db54327a1e4913ea3006

Changed in openstack-ansible:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible (stable/2023.1)

Fix proposed to branch: stable/2023.1
Review: https://review.opendev.org/c/openstack/openstack-ansible/+/898072

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible (stable/zed)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible (stable/yoga)

Fix proposed to branch: stable/yoga
Review: https://review.opendev.org/c/openstack/openstack-ansible/+/898074

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible (stable/xena)

Fix proposed to branch: stable/xena
Review: https://review.opendev.org/c/openstack/openstack-ansible/+/898075

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible (stable/2023.1)

Reviewed: https://review.opendev.org/c/openstack/openstack-ansible/+/898072
Committed: https://opendev.org/openstack/openstack-ansible/commit/f6eb26a5da73188a867c95ddd07a30ab479bf86b
Submitter: "Zuul (22348)"
Branch: stable/2023.1

commit f6eb26a5da73188a867c95ddd07a30ab479bf86b
Author: Dmitriy Rabotyagov <email address hidden>
Date: Thu Aug 17 14:29:25 2023 +0200

    Define install_method default when hosts resolution depend on it

    In some playbooks we try to fetch openstack_service_setup_host based on
    install_method variable. However, if variable is not defined,
    and it is not by default, playbooks will run against localhost,
    which will result in failure.

    Closes-Bug: #2031647
    Change-Id: I247ce2a808076ff55347db54327a1e4913ea3006
    (cherry picked from commit f05c90103cdc3e18ae8b100fb4f260d2809168d9)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible 27.2.0

This issue was fixed in the openstack/openstack-ansible 27.2.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible (stable/zed)

Reviewed: https://review.opendev.org/c/openstack/openstack-ansible/+/898073
Committed: https://opendev.org/openstack/openstack-ansible/commit/49677812ae3d9051a5969b949462cb8ed5d4c6a0
Submitter: "Zuul (22348)"
Branch: stable/zed

commit 49677812ae3d9051a5969b949462cb8ed5d4c6a0
Author: Dmitriy Rabotyagov <email address hidden>
Date: Thu Aug 17 14:29:25 2023 +0200

    Define install_method default when hosts resolution depend on it

    In some playbooks we try to fetch openstack_service_setup_host based on
    install_method variable. However, if variable is not defined,
    and it is not by default, playbooks will run against localhost,
    which will result in failure.

    Closes-Bug: #2031647
    Change-Id: I247ce2a808076ff55347db54327a1e4913ea3006
    (cherry picked from commit f05c90103cdc3e18ae8b100fb4f260d2809168d9)

tags: added: in-stable-zed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible (stable/yoga)

Reviewed: https://review.opendev.org/c/openstack/openstack-ansible/+/898074
Committed: https://opendev.org/openstack/openstack-ansible/commit/e0c3efb14bb8918ca8d05679b6fcd988edb2c63c
Submitter: "Zuul (22348)"
Branch: stable/yoga

commit e0c3efb14bb8918ca8d05679b6fcd988edb2c63c
Author: Dmitriy Rabotyagov <email address hidden>
Date: Thu Aug 17 14:29:25 2023 +0200

    Define install_method default when hosts resolution depend on it

    In some playbooks we try to fetch openstack_service_setup_host based on
    install_method variable. However, if variable is not defined,
    and it is not by default, playbooks will run against localhost,
    which will result in failure.

    Closes-Bug: #2031647
    Change-Id: I247ce2a808076ff55347db54327a1e4913ea3006
    (cherry picked from commit f05c90103cdc3e18ae8b100fb4f260d2809168d9)

tags: added: in-stable-yoga
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible (stable/xena)

Reviewed: https://review.opendev.org/c/openstack/openstack-ansible/+/898075
Committed: https://opendev.org/openstack/openstack-ansible/commit/5064a6d10f9123700c6b4438af26565d38a16d14
Submitter: "Zuul (22348)"
Branch: stable/xena

commit 5064a6d10f9123700c6b4438af26565d38a16d14
Author: Dmitriy Rabotyagov <email address hidden>
Date: Thu Aug 17 14:29:25 2023 +0200

    Define install_method default when hosts resolution depend on it

    In some playbooks we try to fetch openstack_service_setup_host based on
    install_method variable. However, if variable is not defined,
    and it is not by default, playbooks will run against localhost,
    which will result in failure.

    Closes-Bug: #2031647
    Change-Id: I247ce2a808076ff55347db54327a1e4913ea3006
    (cherry picked from commit f05c90103cdc3e18ae8b100fb4f260d2809168d9)

tags: added: in-stable-xena
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible 25.6.0

This issue was fixed in the openstack/openstack-ansible 25.6.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible 26.4.0

This issue was fixed in the openstack/openstack-ansible 26.4.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible 28.0.0.0rc1

This issue was fixed in the openstack/openstack-ansible 28.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible xena-eom

This issue was fixed in the openstack/openstack-ansible xena-eom release.

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.