ANSIBLE_ROLE_FETCH_MODE = 'git-clone' should not source openstack-ansible.rc

Bug #1707967 reported by Jesse Pretorius
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack-Ansible
Fix Released
High
Jean-Philippe Evrard

Bug Description

In the bootstrap-ansible script, if the fetch mode is set to git-clone then the ansible-playbook wrapper will source the openstack-ansible.rc file because it's executed from within the openstack-ansible git tree.

It's probably best for that instance of the ansible-playbook command to be executed directly from the venv instead of using the wrapper, unless there's a different way to avoid sourcing the openstack-ansible.rc file and therefore including the dynamic inventory, plugins, etc which may not be present, or may be there from a previous clone and therefore cause unwanted side-effects.

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

We just need to adapt the openstack-ansible.rc with a full path.

Changed in openstack-ansible:
status: New → Confirmed
tags: added: low-hanging-fruit
Changed in openstack-ansible:
importance: Undecided → High
Revision history for this message
Jesse Pretorius (jesse-pretorius) wrote :

ie in https://github.com/openstack/openstack-ansible/blob/master/scripts/bootstrap-ansible.sh#L259 change 'ansible-playbook get-ansible-role-requirements.yml' to '/opt/ansible-runtime/bin/ansible-playbook get-ansible-role-requirements.yml' or something to that effect

Changed in openstack-ansible:
assignee: nobody → Jean-Philippe Evrard (jean-philippe-evrard)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible (master)

Fix proposed to branch: master
Review: https://review.openstack.org/512303

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

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

commit a27be7f4096a20d3e2549bb31c53849f92c17c97
Author: Jean-Philippe Evrard <email address hidden>
Date: Mon Oct 16 13:48:04 2017 +0000

    Do not source openstack-ansible.rc when pulling roles

    Maybe there are variables that are set that should be ignored
    during the bootstrap. This ensures the environment is clean and
    working as expected from a clean ansible.

    Change-Id: I1065f7b8e5d84de02252f050e37ba2f1c523770b
    Closes-Bug: #1707967

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/pike)

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/525699

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

Reviewed: https://review.openstack.org/525699
Committed: https://git.openstack.org/cgit/openstack/openstack-ansible/commit/?id=fa2ddbb361ea8e96992e1b88aee1105f8b8793e9
Submitter: Zuul
Branch: stable/pike

commit fa2ddbb361ea8e96992e1b88aee1105f8b8793e9
Author: Jean-Philippe Evrard <email address hidden>
Date: Mon Oct 16 13:48:04 2017 +0000

    Do not source openstack-ansible.rc when pulling roles

    Maybe there are variables that are set that should be ignored
    during the bootstrap. This ensures the environment is clean and
    working as expected from a clean ansible.

    Change-Id: I1065f7b8e5d84de02252f050e37ba2f1c523770b
    Closes-Bug: #1707967
    (cherry picked from commit a27be7f4096a20d3e2549bb31c53849f92c17c97)

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

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

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

This issue was fixed in the openstack/openstack-ansible 17.0.0.0b2 development milestone.

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.