Prechecks fail on Xenial with "ERROR! 'ansible_python' is undefined"

Bug #1680135 reported by Ben Swartzlander
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
kolla-ansible
Invalid
Undecided
Unassigned

Bug Description

I followed the quick start guide using the "deployment" path on Ubuntu Xenial. It fails at the prechecks step:

# kolla-ansible prechecks -i /root/all-in-one
Pre-deployment checking : ansible-playbook -i /root/all-in-one -e @/etc/kolla/globals.yml -e @/etc/kolla/passwords.yml -e CONFIG_DIR=/etc/kolla -e action=precheck /usr/local/share/kolla-ansible/ansible/site.yml

PLAY [Gather facts for all hosts] **********************************************

TASK [setup] *******************************************************************
ok: [localhost]

PLAY [Gather facts for all hosts (if using --limit)] ***************************

TASK [setup] *******************************************************************
skipping: [localhost] => (item=localhost)

PLAY [Detect openstack_release variable] ***************************************

TASK [Get current kolla-ansible version number] ********************************
ok: [localhost -> localhost]

TASK [Set openstack_release variable] ******************************************
ok: [localhost]

PLAY [Apply role prechecks] ****************************************************

TASK [setup] *******************************************************************
ok: [localhost]

TASK [prechecks : include] *****************************************************
included: /usr/local/share/kolla-ansible/ansible/roles/prechecks/tasks/port_checks.yml for localhost

TASK [prechecks : Checking the api_interface is present] ***********************
skipping: [localhost]

TASK [prechecks : Checking the api_interface is active] ************************
skipping: [localhost]

TASK [prechecks : Checking the api_interface configuration] ********************
skipping: [localhost]

TASK [prechecks : Checking the api_interface ip address configuration] *********
skipping: [localhost]

TASK [prechecks : include] *****************************************************
included: /usr/local/share/kolla-ansible/ansible/roles/prechecks/tasks/service_checks.yml for localhost

TASK [prechecks : Checking Docker version] *************************************
ok: [localhost]

TASK [prechecks : Checking empty passwords in passwords.yml. Run kolla-genpwd if this task fails] ***
ok: [localhost -> localhost]

TASK [prechecks : include] *****************************************************
included: /usr/local/share/kolla-ansible/ansible/roles/prechecks/tasks/package_checks.yml for localhost

TASK [prechecks : Checking docker-py version] **********************************
fatal: [localhost]: FAILED! => {"failed": true, "msg": "ERROR! 'ansible_python' is undefined"}

PLAY RECAP *********************************************************************
localhost : ok=9 changed=0 unreachable=0 failed=1

Command failed ansible-playbook -i /root/all-in-one -e @/etc/kolla/globals.yml -e @/etc/kolla/passwords.yml -e CONFIG_DIR=/etc/kolla -e action=precheck /usr/local/share/kolla-ansible/ansible/site.yml

Changed in kolla-ansible:
status: New → Confirmed
Changed in kolla-ansible:
assignee: nobody → shaofeng cheng (shaofeng-cheng)
Revision history for this message
shaofeng cheng (shaofeng-cheng) wrote :

This patch caused by error.
https://review.openstack.org/#/c/424515/

Revision history for this message
shaofeng cheng (shaofeng-cheng) wrote :

Please exec command in kolla-master

pip list | grep ansible

if fine,exec command

ansible localhost -m setup -a "filter=ansible_python"

Changed in kolla-ansible:
status: Confirmed → Incomplete
Revision history for this message
Simon Guyennet (sguyennet) wrote :
Download full text (3.2 KiB)

I've got the exact same issue on Xenial.

# pip list | grep ansible
ansible (2.0.0.2)
kolla-ansible (4.0.0)

# ansible localhost -m setup -a "filter=ansible_python"
localhost | SUCCESS => {
    "ansible_facts": {},
    "changed": false
}

# kolla-ansible prechecks -i /usr/local/share/kolla-ansible/ansible/inventory/all-in-one
Pre-deployment checking : ansible-playbook -i /usr/local/share/kolla-ansible/ansible/inventory/all-in-one -e @/etc/kolla/globals.yml -e @/etc/kolla/passwords.yml -e CONFIG_DIR=/etc/kolla -e action=precheck /usr/local/share/kolla-ansible/ansible/site.yml

PLAY [Gather facts for all hosts] **********************************************

TASK [setup] *******************************************************************
ok: [localhost]

PLAY [Gather facts for all hosts (if using --limit)] ***************************

TASK [setup] *******************************************************************
skipping: [localhost] => (item=localhost)

PLAY [Detect openstack_release variable] ***************************************

TASK [Get current kolla-ansible version number] ********************************
ok: [localhost -> localhost]

TASK [Set openstack_release variable] ******************************************
ok: [localhost]

PLAY [Apply role prechecks] ****************************************************

TASK [setup] *******************************************************************
ok: [localhost]

TASK [prechecks : include] *****************************************************
included: /usr/local/share/kolla-ansible/ansible/roles/prechecks/tasks/port_checks.yml for localhost

TASK [prechecks : Checking the api_interface is present] ***********************
skipping: [localhost]

TASK [prechecks : Checking the api_interface is active] ************************
skipping: [localhost]

TASK [prechecks : Checking the api_interface configuration] ********************
skipping: [localhost]

TASK [prechecks : Checking the api_interface ip address configuration] *********
skipping: [localhost]

TASK [prechecks : include] *****************************************************
included: /usr/local/share/kolla-ansible/ansible/roles/prechecks/tasks/service_checks.yml for localhost

TASK [prechecks : Checking Docker version] *************************************
ok: [localhost]

TASK [prechecks : Checking empty passwords in passwords.yml. Run kolla-genpwd if this task fails] ***
ok: [localhost -> localhost]

TASK [prechecks : include] *****************************************************
included: /usr/local/share/kolla-ansible/ansible/roles/prechecks/tasks/package_checks.yml for localhost

TASK [prechecks : Checking docker-py version] **********************************
fatal: [localhost]: FAILED! => {"failed": true, "msg": "ERROR! 'ansible_python' is undefined"}

PLAY RECAP *********************************************************************
localhost : ok=9 changed=0 unreachable=0 failed=1

Command failed ansible-playbook -i /usr/local/share/kolla-ansible/ansible/inventory/all-in-one -e @/etc/kolla/globals.yml -e @/etc/kolla/passwords.yml -e CONFIG_DIR=/etc/kolla -e action=precheck /usr/local/share/kol...

Read more...

Revision history for this message
shaofeng cheng (shaofeng-cheng) wrote :

Plese update ansible version >= 2.1.0.0

complete,recheck.
such as:
ansible localhost -m setup -a "filter=ansible_python"
 [WARNING]: Host file not found: /etc/ansible/hosts

localhost | SUCCESS => {
    "ansible_facts": {
        "ansible_python": {
            "executable": "/usr/bin/python2.7",
            "has_sslcontext": true,
            "type": "CPython",
            "version": {
                "major": 2,
                "micro": 12,
                "minor": 7,
                "releaselevel": "final",
                "serial": 0
            },
            "version_info": [
                2,
                7,
                12,
                "final",
                0
            ]
        }
    },
    "changed": false
}

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (master)

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

Changed in kolla-ansible:
status: Incomplete → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on kolla-ansible (master)

Change abandoned by shaofeng cheng (<email address hidden>) on branch: master
Review: https://review.openstack.org/455109
Reason: other review

Revision history for this message
shaofeng cheng (shaofeng-cheng) wrote :
Changed in kolla-ansible:
assignee: shaofeng cheng (shaofeng-cheng) → nobody
Revision history for this message
Simon Guyennet (sguyennet) wrote :

It is working fine with ansible 2.2.2.0. The documentation should be updated.

Thanks a lot.

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