Bug 1613754 - CFME deploy playbook failed for undefined openshift_hosted_infra_selector var
Summary: CFME deploy playbook failed for undefined openshift_hosted_infra_selector var
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer
Version: 3.11.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 3.11.0
Assignee: Vadim Rutkovsky
QA Contact: Gaoyun Pei
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-08-08 09:51 UTC by Gaoyun Pei
Modified: 2018-10-19 10:44 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-11 07:24:08 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3627471 0 None None None 2018-09-27 08:09:12 UTC
Red Hat Product Errata RHBA-2018:2652 0 None None None 2018-10-11 07:24:26 UTC

Description Gaoyun Pei 2018-08-08 09:51:26 UTC
Description of problem:
Run the following playbook to deploy CFME on ocp-3.11, but it fails as below:

ansible-playbook -i host/311 /usr/share/ansible/openshift-ansible/playbooks/openshift-management/config.yml -v

...

TASK [openshift_management : Ensure the Management 'openshift-management' namespace exists] *********************************************************************************
fatal: [ec2-52-54-255-18.compute-1.amazonaws.com]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'openshift_hosted_infra_selector' is undefined\n\nThe error appears to have been in '/usr/share/ansible/openshift-ansible/roles/openshift_management/tasks/main.yml': line 14, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: \"Ensure the Management '{{ openshift_management_project }}' namespace exists\"\n  ^ here\nWe could be wrong, but this one looks like it might be an issue with\nmissing quotes.  Always quote template expression brackets when they\nstart a value. For instance:\n\n    with_items:\n      - {{ foo }}\n\nShould be written as:\n\n    with_items:\n      - \"{{ foo }}\"\n"}
	to retry, use: --limit @/usr/share/ansible/openshift-ansible/playbooks/openshift-management/config.retry


This should be a regression issue introduced by
https://github.com/openshift/openshift-ansible/pull/8640

openshift_management_nodeselector doesn't have a default value when openshift_hosted_infra_selector not defined.


Version-Release number of the following components:
openshift-ansible-3.11.0-0.11.0.git.0.3c66516None.noarch
ansible-2.6.2-1.el7ae.noarch


How reproducible:
100%

Steps to Reproduce:
1.
2.
3.

Actual results:
Please include the entire output from the last TASK line through the end of output if an error is generated

Expected results:

Additional info:
Please attach logs from ansible-playbook with the -vvv flag

Comment 1 Scott Dodson 2018-08-08 12:26:26 UTC
Looks like this has been cherrypicked back into 3.10 and 3.9 too so we need to fix it there.

Comment 2 Vadim Rutkovsky 2018-08-10 11:49:00 UTC
Created PR to master: https://github.com/openshift/openshift-ansible/pull/9521

Comment 4 Vadim Rutkovsky 2018-08-15 12:03:08 UTC
Fix is available in openshift-ansible-3.11.0-0.16.0

Comment 5 Gaoyun Pei 2018-08-16 06:19:23 UTC
Test with openshift-ansible-3.11.0-0.16.0.git.0.e82689aNone.noarch, still failed.

TASK [openshift_management : Ensure the Management 'openshift-management' namespace exists] *********************************************************************************
task path: /usr/share/ansible/openshift-ansible/roles/openshift_management/tasks/main.yml:14

The full traceback is:
  File "/tmp/ansible_c5HJPA/ansible_modlib.zip/ansible/module_utils/basic.py", line 2111, in _check_argument_types
    param[k] = type_checker(value)
  File "/tmp/ansible_c5HJPA/ansible_modlib.zip/ansible/module_utils/basic.py", line 1913, in _check_type_list
    raise TypeError('%s cannot be converted to a list' % type(value))

fatal: [ec2-52-205-199-158.compute-1.amazonaws.com]: FAILED! => {
    "changed": false, 
    "invocation": {
        "module_args": {
            "admin_role": "admin", 
            "debug": false, 
            "display_name": "CloudForms Management Engine", 
            "kubeconfig": "/etc/origin/master/admin.kubeconfig", 
            "name": "openshift-management", 
            "node_selector": {
                "node-role.kubernetes.io/infra": "true"
            }, 
            "state": "present"
        }
    }, 
    "msg": "argument node_selector is of type <type 'dict'> and we were unable to convert to list: <type 'dict'> cannot be converted to a list"
}

Comment 6 Vadim Rutkovsky 2018-08-16 10:47:02 UTC
Ah, right, this nodeselector is used in oc_project, which requires a different format

Created https://github.com/openshift/openshift-ansible/pull/9625 to fix it

Comment 7 Vadim Rutkovsky 2018-08-17 07:38:26 UTC
Fix is available in openshift-ansible-3.11.0-0.17.0

Comment 8 Gaoyun Pei 2018-08-20 03:32:12 UTC
Verify this bug with openshift-ansible-3.11.0-0.17.0.git.0.d3888d7None.noarch.

With default options, playbooks/openshift-management/config.yml could run without error.

TASK [openshift_management : Ensure the Management 'openshift-management' namespace exists] *********************************************************************************
changed: [ec2-52-206-170-73.compute-1.amazonaws.com] => {"changed": true, "results": {"cmd": "/usr/bin/oc get namespace openshift-management -o json", "results": {"apiVersion": "v1", "kind": "Namespace", "metadata": {"annotations": {"openshift.io/description": "", "openshift.io/display-name": "CloudForms Management Engine", "openshift.io/node-selector": "node-role.kubernetes.io/infra=true", "openshift.io/sa.scc.mcs": "s0:c17,c4", "openshift.io/sa.scc.supplemental-groups": "1000280000/10000", "openshift.io/sa.scc.uid-range": "1000280000/10000"}, "creationTimestamp": "2018-08-20T03:17:33Z", "name": "openshift-management", "resourceVersion": "14178", "selfLink": "/api/v1/namespaces/openshift-management", "uid": "9430f2af-a427-11e8-9ab9-0e6cea204162"}, "spec": {"finalizers": ["kubernetes"]}, "status": {"phase": "Active"}}, "returncode": 0}, "state": "present"}

Comment 11 errata-xmlrpc 2018-10-11 07:24:08 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:2652


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