Description of problem: Installation would failed at task "[openshift_cloud_provider : Create cloud config]" when enabling OpenStack cloudprovider. Version-Release number of selected component (if applicable): openshift-ansible-3.2.36-1.git.0.164eb4c.el7.noarch.rpm ansible-2.2.0.0-0.62.rc1.el7.noarch How reproducible: always Steps to Reproduce: 1.cat hosts <--snip--> openshift_cloudprovider_kind=openstack openshift_cloudprovider_openstack_auth_url=xxxxx openshift_cloudprovider_openstack_username=xxxx openshift_cloudprovider_openstack_password=xxxx openshift_cloudprovider_openstack_tenant_id=xxxxx openshift_cloudprovider_openstack_region=RegionOne <--snip--> 2.Run BYO playbook 3. Actual results: TASK [openshift_cloud_provider : Create cloud config] ************************** Thursday 27 October 2016 06:04:28 +0000 (0:00:00.093) 0:07:00.442 ****** fatal: [openshift-133.lab.sjc.redhat.com]: FAILED! => {"changed": false, "failed": true, "msg": "AnsibleUndefinedVariable: Unable to look up a name or access an attribute in template string ([Global]\nauth-url = {{ openshift_cloudprovider_openstack_auth_url }}\nusername = {{ openshift_cloudprovider_openstack_username }}\npassword = {{ openshift_cloudprovider_openstack_password }}\n{% if openshift_cloudprovider_openstack_tenant_id is defined %}\ntenant-id = {{ openshift_cloudprovider_openstack_tenant_id }}\n{% else %}\ntenant-name = {{ openshift_cloudprovider_openstack_tenant_name }}\n{% endif %}\n{% if openshift_cloudprovider_openstack_region is defined %}\nregion = {{ openshift_cloudprovider_openstack_region }}\n{% endif %}\n{% if 'lb_subnet_id' in openshift_cloudprovider_openstack %}\n[LoadBalancer]\nsubnet-id = {{ openshift_cloudprovider_openstack_lb_subnet_id }}\n{% endif %}\n).\nMake sure your variable name does not contain invalid characters like '-': argument of type 'StrictUndefined' is not iterable"} Expected results: Installation success when enabling cloudprovider Additional info:
Looks like it works for me to modify: {% if 'lb_subnet_id' in openshift_cloudprovider_openstack %} to {% if openshift_cloudprovider_openstack_lb_subnet_id is defined %}
Problem only exists in 3.2.
Gan's fix is here https://github.com/openshift/openshift-ansible/pull/2675
Still present in 3.2.36-1
PR is not merged to openshift-ansible-3.2.37-1
In openshift-ansible-3.2.38-1
Verified with openshift-ansible-3.2.39-1.git.0.2c9adff.el7.noarch.rpm Installation succeed when enabling OpenStack cloudprovider.
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/RHSA-2016:2778