Bug 1671342 - openshift_facts cannot split due to insufficient values
Summary: openshift_facts cannot split due to insufficient values
Keywords:
Status: CLOSED DUPLICATE of bug 1667270
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer
Version: 3.11.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
: 3.11.z
Assignee: Tzu-Mainn Chen
QA Contact: Johnny Liu
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-01-31 13:02 UTC by Gabriel Stein
Modified: 2019-10-22 11:54 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-10-22 11:54:21 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Gabriel Stein 2019-01-31 13:02:56 UTC
Description of problem:

I'm installing OpenShift 3.11 on top of OpenStack 13(Queens). There is a Bug[0] for the version 3.9(and also 3.11) from OpenShift that breaks the installation process from OpenShift when running the prerequisites.yml playbook.

The error from previous Bug was that the return from a test curl command return two IPs from a node, but on my environment returns just one of them and the split function committed here[1] gives an error because there is nothing to split[2](just 1 value, nothing to split). This was released into this ERRATA[3].

Error:

fatal: [node1]: FAILED! => {"changed": false, "module_stderr": "Shared connection to node1 closed.\r\n", "module_stdout": "KeyError('ansible_os_family',)\r\nTraceback (most recent call last):\r\n  File \"/tmp/an
sible_g059wU/ansible_module_openshift_facts.py\", line 1300, in <module>\r\n    main()\r\n  File \"/tmp/ansible_g059wU/ansible_module_openshift_facts.py\", line 1287, in main\r\n    additive_facts_to_overwrite)\
r\n  File \"/tmp/ansible_g059wU/ansible_module_openshift_facts.py\", line 1039, in __init__\r\n    additive_facts_to_overwrite)\r\n  File \"/tmp/ansible_g059wU/ansible_module_openshift_facts.py\", line 1061, in
generate_facts\r\n    provider_facts = self.init_provider_facts()\r\n  File \"/tmp/ansible_g059wU/ansible_module_openshift_facts.py\", line 1194, in init_provider_facts\r\n    provider_info.get('metadata')\r\n 
File \"/tmp/ansible_g059wU/ansible_module_openshift_facts.py\", line 345, in normalize_provider_facts\r\n    facts = normalize_openstack_facts(metadata, facts)\r\n  File \"/tmp/ansible_g059wU/ansible_module_open
shift_facts.py\", line 315, in normalize_openstack_facts\r\n    facts['network'][f_var] = metadata['ec2_compat'][ip_var].split(',')[0]\r\nAttributeError: 'list' object has no attribute 'split'\r\n", "msg": "MODU
LE FAILURE", "rc": 1}

0 - https://bugzilla.redhat.com/show_bug.cgi?id=1648832
1 - https://github.com/openshift/openshift-ansible/pull/10670/commits/dfb95684ef5f636f0595e311e0c5169ee5c1ec92
[2] - Command: curl http://169.254.169.254/latest/meta-data/local-ipv4
[3] - https://access.redhat.com/errata/RHBA-2019:0024

Version-Release number of selected component (if applicable):

- OpenStack 13
- OpenShift 3.11
- ansible 2.6.12
- For more, e.g. sosreports I can upload here too.


How reproducible:


Steps to Reproduce:
1. Install openshift-ansible package on a bastion on top of OpenStack
2. Run prerequisites.yml playbook
3. It stops with the error above on 'Gathering Cluster Facts'

Actual results:

fatal: [node1]: FAILED! => {"changed": false, "module_stderr": "Shared connection to node1 closed.\r\n", "module_stdout": "KeyError('ansible_os_family',)\r\nTraceback (most recent call last):\r\n  File \"/tmp/an
sible_g059wU/ansible_module_openshift_facts.py\", line 1300, in <module>\r\n    main()\r\n  File \"/tmp/ansible_g059wU/ansible_module_openshift_facts.py\", line 1287, in main\r\n    additive_facts_to_overwrite)\
r\n  File \"/tmp/ansible_g059wU/ansible_module_openshift_facts.py\", line 1039, in __init__\r\n    additive_facts_to_overwrite)\r\n  File \"/tmp/ansible_g059wU/ansible_module_openshift_facts.py\", line 1061, in
generate_facts\r\n    provider_facts = self.init_provider_facts()\r\n  File \"/tmp/ansible_g059wU/ansible_module_openshift_facts.py\", line 1194, in init_provider_facts\r\n    provider_info.get('metadata')\r\n 
File \"/tmp/ansible_g059wU/ansible_module_openshift_facts.py\", line 345, in normalize_provider_facts\r\n    facts = normalize_openstack_facts(metadata, facts)\r\n  File \"/tmp/ansible_g059wU/ansible_module_open
shift_facts.py\", line 315, in normalize_openstack_facts\r\n    facts['network'][f_var] = metadata['ec2_compat'][ip_var].split(',')[0]\r\nAttributeError: 'list' object has no attribute 'split'\r\n", "msg": "MODU
LE FAILURE", "rc": 1}

Expected results:

- To run without errors

Additional info:

Comment 1 Gabriel Stein 2019-01-31 13:06:38 UTC
Workaround til now:

- Open /usr/share/ansible/openshift-ansible/roles/openshift_facts/library/openshift_facts.py
- Go for the line 340.
- Undo the changes made on this PR[0]. Pay attention to the identation, python is really 'sensible' with that.
- Run the playbook again

[0] - https://github.com/openshift/openshift-ansible/pull/10670/commits/dfb95684ef5f636f0595e311e0c5169ee5c1ec92

Comment 2 Tzu-Mainn Chen 2019-01-31 14:21:15 UTC
Hi Gabriel! Does your build contain this fix for the issue? https://github.com/openshift/openshift-ansible/pull/10974

I believe it solved similar issues

Comment 3 Gabriel Stein 2019-01-31 14:31:26 UTC
Hi Tzu-Mainn

it looks similar to https://github.com/openshift/openshift-ansible/pull/10670/commits/dfb95684ef5f636f0595e311e0c5169ee5c1ec92 when I revert the changes.

Could you explain to me the difference between both?

Thanks!

All the best!

Gabriel

Comment 4 Tzu-Mainn Chen 2019-01-31 15:32:40 UTC
Sure; the cases I've seen of this so far are:

a) a single comma separated string
b) an empty list

The initial PR handled a), but made b) a fail condition; the subsequent PR handles b).

Comment 5 Johnny Liu 2019-02-01 02:44:41 UTC
Seem like a dup with BZ#1667270

Comment 6 Eric Duen 2019-10-22 11:54:21 UTC
Duplicate, closing

*** This bug has been marked as a duplicate of bug 1667270 ***


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