Bug 1670520 - fails to complete when /usr/bin/python is not found
Summary: fails to complete when /usr/bin/python is not found
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Ceph Storage
Classification: Red Hat Storage
Component: Ceph-Ansible
Version: 3.2
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: 4.0
Assignee: Guillaume Abrioux
QA Contact: Vasishta
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-01-29 18:05 UTC by Alfredo Deza
Modified: 2020-01-31 12:46 UTC (History)
8 users (show)

Fixed In Version: ceph-ansible-4.0.0beta1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-01-31 12:45:35 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github ceph/ceph-ansible/commit/b94290af432008c715922052a887ce08d40ff484 0 None None None 2020-05-06 19:34:54 UTC
Red Hat Product Errata RHBA-2020:0312 0 None None None 2020-01-31 12:46:11 UTC

Description Alfredo Deza 2019-01-29 18:05:17 UTC
Description of problem: When deploying containers, the `site-docker.yml.sample` does not have the pre-tasks that `site.yml.sample` does which ensures Python2 is installed and available, this causes the playbook to fail as it can't find a Python executable.


How reproducible: 100% of the time


Steps to Reproduce:
1. On a Python3 system (e.g. Ubuntu Bionic) use site-docker.yml.sample to deploy
2. 
3.

Actual results: Failure happens with messaging like:

> failed: [node1 -> node4] (item=node4) => {"changed": false, "item": "node4", "module_stderr": "/bin/sh: 1: /usr/bin/python: not found\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 127}


Expected results: playbook installs missing dependencies if any


Additional info:
Adding the same pre-tasks that exist in site.yml.sample allows the playbook to continue:

git diff
diff --git a/site-docker.yml.sample b/site-docker.yml.sample
index 82099535..bf23397a 100644
--- a/site-docker.yml.sample
+++ b/site-docker.yml.sample
@@ -23,6 +23,32 @@
     delegate_facts_host: True

   pre_tasks:
+    # If we can't get python2 installed before any module is used we will fail
+    # so just try what we can to get it installed
+    - name: check for python2
+      stat:
+        path: /usr/bin/python
+      ignore_errors: yes
+      register: systempython2
+
+    - name: install python2 for debian based systems
+      raw: sudo apt-get -y install python-simplejson
+      ignore_errors: yes
+      when:
+        - systempython2.stat is undefined or systempython2.stat.exists == false
+
+    - name: install python2 for fedora
+      raw: sudo dnf -y install python creates=/usr/bin/python
+      ignore_errors: yes
+      when:
+        - systempython2.stat is undefined or systempython2.stat.exists == false
+
+    - name: install python2 for opensuse
+      raw: sudo zypper -n install python-base creates=/usr/bin/python2.7
+      ignore_errors: yes
+      when:
+        - systempython2.stat is undefined or systempython2.stat.exists == false
+
     - name: gather facts
       setup:
       when:

Comment 3 Giridhar Ramaraju 2019-08-05 13:06:04 UTC
Updating the QA Contact to a Hemant. Hemant will be rerouting them to the appropriate QE Associate. 

Regards,
Giri

Comment 4 Giridhar Ramaraju 2019-08-05 13:08:47 UTC
Updating the QA Contact to a Hemant. Hemant will be rerouting them to the appropriate QE Associate. 

Regards,
Giri

Comment 8 errata-xmlrpc 2020-01-31 12:45:35 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, 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-2020:0312


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