[master] Deployment with ansible 2.9 Fails outside of CI

Bug #1873443 reported by yatin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Medium
yatin

Bug Description

Deployment with ansible 2.9 fails when /usr/local/bin is not added in secure_path in /etc/sudoers.

But when tried deployment in a local vm deployment failed as follows:-
Image prepare failed: [Errno 2] No such file or directory: 'ansible-playbook-3': 'ansible-playbook-3'
concurrent.futures.process._RemoteTraceback:
"""
Traceback (most recent call last):
  File "/usr/lib64/python3.6/concurrent/futures/process.py", line 175, in _process_worker
    r = call_item.fn(*call_item.args, **call_item.kwargs)
  File "/usr/lib64/python3.6/concurrent/futures/process.py", line 153, in _process_chunk
    return [fn(*args) for args in chunk]
  File "/usr/lib64/python3.6/concurrent/futures/process.py", line 153, in <listcomp>
    return [fn(*args) for args in chunk]
  File "/usr/lib/python3.6/site-packages/tripleo_common/image/image_uploader.py", line 2535, in upload_task
    return uploader.upload_image(task)
  File "/usr/lib/python3.6/site-packages/tripleo_common/image/image_uploader.py", line 1560, in upload_image
    container_build_tool='buildah')
  File "/usr/lib/python3.6/site-packages/tripleo_common/image/image_uploader.py", line 542, in run_modify_playbook
    ).run(None)
  File "/usr/lib/python3.6/site-packages/tripleo_common/actions/ansible.py", line 496, in run
    log_errors=processutils.LogErrors.ALL)
  File "/usr/lib/python3.6/site-packages/oslo_concurrency/processutils.py", line 391, in execute
    env=env_variables)
  File "/usr/lib64/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/usr/lib64/python3.6/subprocess.py", line 1364, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'ansible-playbook-3': 'ansible-playbook-3'

This happening because ansible rpm stopped creating /usr/bin/ansible-playbook-3 with [3].

In CI when trying with ansible 2.9[1] didn't faced the issue because nodepool images adds /usr/local/bin in secure_path[2] and tripleo-ansible creates ansible-playbook-3 under /usr/local/bin/[4].

I think in master which is python3 only all such occurances of versioned binaries can be dropped. Until all such occurrences are cleared we can add /usr/bin/ansible-playbook-3 explicitly if it doesn't exist.

[1] https://review.opendev.org/#/c/719445/
[2] https://opendev.org/openstack/diskimage-builder/src/branch/master/diskimage_builder/elements/rpm-distro/pre-install.d/00-usr-local-bin-secure-path#L9
[3] https://src.fedoraproject.org/rpms/ansible/c/88ed9f12192e8462526dacdd28d85aa749c34458?branch=master
[4] https://github.com/openstack/tripleo-ansible/blob/6a8df59dbd4ddc070abb7cc2b815ea62ead39484/tripleo_ansible/roles/tripleo_bootstrap/tasks/main.yml#L116

yatin (yatinkarel)
Changed in tripleo:
milestone: none → ussuri-rc1
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → yatin (yatinkarel)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-ansible (master)

Fix proposed to branch: master
Review: https://review.opendev.org/720694

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

Reviewed: https://review.opendev.org/720694
Committed: https://git.openstack.org/cgit/openstack/tripleo-ansible/commit/?id=780b5fc46d805ae50af9ffefff76d6786d52d071
Submitter: Zuul
Branch: master

commit 780b5fc46d805ae50af9ffefff76d6786d52d071
Author: yatinkarel <email address hidden>
Date: Fri Apr 17 17:11:22 2020 +0530

    Create Symlink /usr/bin/ansible-playbook-3 when not exist

    ansible-playbook-3 binary is no longer shipped with
    ansible 2.9 package[1], so let's create it if it doesn't
    exist. Once all usages of ansible-playbook-3 are removed
    these all compatibility tasks can be cleaned up.

    Also remove symlink creation of /usr/local/bin/ansible-playbook*,
    as those were created temporary for fedora support[2].

    [1] https://src.fedoraproject.org/rpms/ansible/blob/master/f/ansible.spec
    [2] https://review.opendev.org/#/c/632768/

    Partial-Bug: #1873443
    Change-Id: I40c860f22993efbe375c741c63513d764ba4eebc

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

Fix proposed to branch: stable/train
Review: https://review.opendev.org/721325

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

Reviewed: https://review.opendev.org/721325
Committed: https://git.openstack.org/cgit/openstack/tripleo-ansible/commit/?id=0b7b2ff40a9e97cae5a08677fb959db0acb415af
Submitter: Zuul
Branch: stable/train

commit 0b7b2ff40a9e97cae5a08677fb959db0acb415af
Author: yatinkarel <email address hidden>
Date: Fri Apr 17 17:11:22 2020 +0530

    Create Symlink /usr/bin/ansible-playbook-3 when not exist

    ansible-playbook-3 binary is no longer shipped with
    ansible 2.9 package[1], so let's create it if it doesn't
    exist. Once all usages of ansible-playbook-3 are removed
    these all compatibility tasks can be cleaned up.

    Also remove symlink creation of /usr/local/bin/ansible-playbook*,
    as those were created temporary for fedora support[2].

    [1] https://src.fedoraproject.org/rpms/ansible/blob/master/f/ansible.spec
    [2] https://review.opendev.org/#/c/632768/

    Partial-Bug: #1873443
    Change-Id: I40c860f22993efbe375c741c63513d764ba4eebc
    (cherry picked from commit 780b5fc46d805ae50af9ffefff76d6786d52d071)

tags: added: in-stable-train
Revision history for this message
yatin (yatinkarel) wrote :

Ansible updated to 2.9.7 with https://review.rdoproject.org/r/#/c/25914/ in Ussuri after getting all required fixes, marking issue Fix Released now.

Changed in tripleo:
status: In Progress → 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.