Bug 1541589

Summary: Installation on GCE failed at TASK [openshift_cloud_provider : check variables are passed]
Product: OpenShift Container Platform Reporter: Weihua Meng <wmeng>
Component: InstallerAssignee: Michael Gugino <mgugino>
Status: CLOSED ERRATA QA Contact: Weihua Meng <wmeng>
Severity: high Docs Contact:
Priority: high    
Version: 3.9.0CC: aos-bugs, jialiu, jokerman, kwoodson, lxia, mgugino, mmccomas, wmeng, xtian
Target Milestone: ---Keywords: Regression
Target Release: 3.9.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-03-28 14:25:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1538581    

Description Weihua Meng 2018-02-03 02:07:59 UTC
Description of problem:
Installation on GCE with cloudprovider enabled failed at TASK [openshift_cloud_provider : check variables are passed]

Version-Release number of the following components:
openshift-ansible-3.9.0-0.36.0.git.0.da68f13.el7.noarch.rpm
ansible-2.4.2.0-2.el7.noarch
# ansible --version
ansible 2.4.2.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.13 (default, Jan 12 2017, 17:59:37) [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)]

How reproducible:
Always

Steps to Reproduce:
1. Install OCP with openshift-ansible
$ ansible-playbook -i hosts openshift-ansible/playbooks/deploy_cluster.yml

Actual results:
TASK [openshift_cloud_provider : include_tasks] ********************************
Saturday 03 February 2018  01:52:30 +0000 (0:00:00.030)       0:03:42.294 ***** 
included: /home/slave3/workspace/Launch Environment Flexy/private-openshift-ansible/roles/openshift_cloud_provider/tasks/gce.yml for qe-wmengrhel39036-me-1.0203-0z5.qe.rhcloud.com

TASK [openshift_cloud_provider : check variables are passed] *******************
Saturday 03 February 2018  01:52:30 +0000 (0:00:00.046)       0:03:42.341 ***** 
failed: [qe-wmengrhel39036-me-1.0203-0z5.qe.rhcloud.com] (item=) => {"changed": false, "item": "", "msg": "Ensure correct variables are defined for gcp. "}
failed: [qe-wmengrhel39036-me-1.0203-0z5.qe.rhcloud.com] (item=) => {"changed": false, "item": "", "msg": "Ensure correct variables are defined for gcp. "}

NO MORE HOSTS LEFT *************************************************************
	to retry, use: --limit @/home/slave3/workspace/Launch Environment Flexy/private-openshift-ansible/playbooks/deploy_cluster.retry


Expected results:
Installation succeeds

Comment 1 Kenny Woodson 2018-02-03 03:16:21 UTC
This role requires that 2 variables are defined in the inventory in order for this role to function.  These 2 variables are:
openshift_gcp_project
openshift_gcp_prefix


Are these settings defined in the inventory?

Comment 2 Weihua Meng 2018-02-03 04:52:39 UTC
They are not defined in the inventory.

They are not needed before.

Could you show me the doc how to set them?

Those variables are not found in 
https://github.com/openshift/openshift-ansible/blob/master/inventory/hosts.example

Comment 3 Johnny Liu 2018-02-09 02:02:07 UTC
If openshift_gcp_project and openshift_gcp_prefix are required option, pls make the variables check failure error be more clear, e.g: which variables should be defined, and what value should be assigned to them, maybe a doc link is a good idea.

Comment 4 Michael Gugino 2018-02-12 19:18:57 UTC
PR created to add better error warning: https://github.com/openshift/openshift-ansible/pull/7117

Comment 6 Weihua Meng 2018-02-22 03:37:54 UTC
Michael, can we show something more helpful as commet 3?

other than this
TASK [openshift_cloud_provider : check variables are passed] *******************
Thursday 22 February 2018  03:20:15 +0000 (0:00:00.046)       0:04:08.305 ***** 
failed: [qe-wmengah39test-master-etcd-1.0222-z93.qe.rhcloud.com] (item={u'name': u'openshift_gcp_project', u'value': u''}) => {"changed": false, "item": {"name": "openshift_gcp_project", "value": ""}, "msg": "Ensure correct variables are defined for gcp. openshift_gcp_project"}
failed: [qe-wmengah39test-master-etcd-1.0222-z93.qe.rhcloud.com] (item={u'name': u'openshift_gcp_prefix', u'value': u''}) => {"changed": false, "item": {"name": "openshift_gcp_prefix", "value": ""}, "msg": "Ensure correct variables are defined for gcp. openshift_gcp_prefix"}

Comment 7 Scott Dodson 2018-02-22 14:25:25 UTC
Lets make sure that these variables are documented in the example inventory.

Comment 8 Michael Gugino 2018-03-05 15:07:53 UTC
Added to example inventory: https://github.com/openshift/openshift-ansible/pull/7308

Comment 10 Weihua Meng 2018-03-07 04:37:34 UTC
Fousing on 3.9 testing.
Since 3.10 is not urgent for now, will deal with it later.

Comment 12 Weihua Meng 2018-03-07 08:13:47 UTC
Not fixed.
openshift-ansible-3.9.3-1.git.0.e166207.el7.noarch

TASK [openshift_cloud_provider : check variables are passed] *******************
Wednesday 07 March 2018  07:35:16 +0000 (0:00:00.047)       0:03:03.269 ******* 
failed: [qe-wmengrpm39bugv2-master-etcd-1.0307-vnw.qe.rhcloud.com] (item={u'name': u'openshift_gcp_project', u'value': u''}) => {"changed": false, "failed": true, "item": {"name": "openshift_gcp_project", "value": ""}, "msg": "Ensure correct variables are defined for gcp. openshift_gcp_project"}
failed: [qe-wmengrpm39bugv2-master-etcd-1.0307-vnw.qe.rhcloud.com] (item={u'name': u'openshift_gcp_prefix', u'value': u''}) => {"changed": false, "failed": true, "item": {"name": "openshift_gcp_prefix", "value": ""}, "msg": "Ensure correct variables are defined for gcp. openshift_gcp_prefix"}

1. target release 3.9

2. more useful information to help customer dealing with this error.(as in commet 3)
Here is an example

TASK [Evaluate groups - Fail if no etcd hosts group is defined] ***************************************************************************************************************************************************
task path: /usr/share/ansible/openshift-ansible/playbooks/common/openshift-cluster/evaluate_groups.yml:43
fatal: [localhost]: FAILED! => {
    "changed": false, 
    "msg": "Running etcd as an embedded service is no longer supported. If this is a new install please define an 'etcd' group with either one, three or five hosts. These hosts may be the same hosts as your masters. If this is an upgrade please see https://docs.openshift.com/container-platform/latest/install_config/upgrading/migrating_embedded_etcd.html for documentation on how to migrate from embedded to external etcd.\n"
}

please ignore commet 10.

Comment 13 Weihua Meng 2018-03-07 10:01:25 UTC
Verified according to  Commet 7 https://bugzilla.redhat.com/show_bug.cgi?id=1541589#c7


https://github.com/openshift/openshift-ansible/blob/openshift-ansible-3.9.3-1/inventory/hosts.example

# GCE
#openshift_cloudprovider_kind=gce
# Note: When using GCE, openshift_gcp_project and openshift_gcp_prefix must be
# defined.
# openshift_gcp_project is the project-id
#openshift_gcp_project=
# openshift_gcp_prefix is a unique string to identify each openshift cluster.
#openshift_gcp_prefix=
#openshift_gcp_multizone=False

Comment 16 errata-xmlrpc 2018-03-28 14:25:43 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-2018:0489