Bug 1501768 - deploy eventrouter failed when openshift_logging_eventrouter_nodeselector was set
Summary: deploy eventrouter failed when openshift_logging_eventrouter_nodeselector was...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer
Version: 3.7.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 3.7.0
Assignee: Jan Wozniak
QA Contact: Anping Li
URL:
Whiteboard: logging
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-10-13 07:35 UTC by Anping Li
Modified: 2017-11-28 22:16 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
undefined
Clone Of:
Environment:
Last Closed: 2017-11-28 22:16:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
The template file generate by playbooks (2.65 KB, text/plain)
2017-10-13 07:40 UTC, Anping Li
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2017:3188 0 normal SHIPPED_LIVE Moderate: Red Hat OpenShift Container Platform 3.7 security, bug, and enhancement update 2017-11-29 02:34:54 UTC

Description Anping Li 2017-10-13 07:35:43 UTC
Description of problem:
deploy eventrouter failed when I set openshift_logging_eventrouter_nodeselector={'region': 'infra'}.

The nodeSelector is a subcontent of the second spec in template file. we should add four extra spaces as the prefix nodeSelector in 

Version-Release number of the following components:
openshift-ansible-3.7.0-0.148.0

How reproducible:
always

Steps to Reproduce:
1. Add openshift_logging_eventrouter variables in inventory  
   openshift_logging_install_eventrouter=true
   openshift_logging_eventrouter_image_prefix=registery.example.com/openshift3/
   openshift_logging_eventrouter_image_version=v3.7
   openshift_logging_eventrouter_nodeselector={'region': 'infra'}
   openshift_logging_eventrouter_namespace=logging


2. deploy logging and eventrouter
   ansible-playbook /usr/share/ansible/openshift-ansible/playbooks/byo/openshift-cluster/openshift-logging.yml -vv|tee deployeventrouter.logs

Actual results:

TASK [openshift_logging_eventrouter : Create EventRouter template] ************************************************************************************************************************************************
task path: /usr/share/ansible/openshift-ansible/roles/openshift_logging_eventrouter/tasks/install_eventrouter.yaml:31
fatal: [openshift-181.lab.eng.nay.redhat.com]: FAILED! => {"changed": false, "failed": true, "module_stderr": "Shared connection to openshift-181.lab.eng.nay.redhat.com closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n  File \"/tmp/ansible_jOrkvw/ansible_module_oc_obj.py\", line 1676, in <module>\r\n    main()\r\n  File \"/tmp/ansible_jOrkvw/ansible_module_oc_obj.py\", line 1669, in main\r\n    rval = OCObject.run_ansible(module.params, module.check_mode)\r\n  File \"/tmp/ansible_jOrkvw/ansible_module_oc_obj.py\", line 1609, in run_ansible\r\n    update = ocobj.needs_update(params['files'], params['content'])\r\n  File \"/tmp/ansible_jOrkvw/ansible_module_oc_obj.py\", line 1523, in needs_update\r\n    data = Utils.get_resource_file(files[0], content_type)\r\n  File \"/tmp/ansible_jOrkvw/ansible_module_oc_obj.py\", line 1236, in get_resource_file\r\n    contents = yaml.safe_load(contents)\r\n  File \"/usr/lib64/python2.7/site-packages/yaml/__init__.py\", line 93, in safe_load\r\n    return load(stream, SafeLoader)\r\n  File \"/usr/lib64/python2.7/site-packages/yaml/__init__.py\", line 71, in load\r\n    return loader.get_single_data()\r\n  File \"/usr/lib64/python2.7/site-packages/yaml/constructor.py\", line 37, in get_single_data\r\n    node = self.get_single_node()\r\n  File \"/usr/lib64/python2.7/site-packages/yaml/composer.py\", line 36, in get_single_node\r\n    document = self.compose_document()\r\n  File \"/usr/lib64/python2.7/site-packages/yaml/composer.py\", line 55, in compose_document\r\n    node = self.compose_node(None, None)\r\n  File \"/usr/lib64/python2.7/site-packages/yaml/composer.py\", line 84, in compose_node\r\n    node = self.compose_mapping_node(anchor)\r\n  File \"/usr/lib64/python2.7/site-packages/yaml/composer.py\", line 133, in compose_mapping_node\r\n    item_value = self.compose_node(node, item_key)\r\n  File \"/usr/lib64/python2.7/site-packages/yaml/composer.py\", line 82, in compose_node\r\n    node = self.compose_s
equence_node(anchor)\r\n  File \"/usr/lib64/python2.7/site-packages/yaml/composer.py\", line 111, in compose_sequence_node\r\n    node.value.append(self.compose_node(node, index))\r\n  File \"/usr/lib64/python2.7/site-packages/yaml/composer.py\", line 84, in compose_node\r\n    node = self.compose_mapping_node(anchor)\r\n  File \"/usr/lib64/python2.7/site-packages/yaml/composer.py\", line 133, in compose_mapping_node\r\n    item_value = self.compose_node(node, item_key)\r\n  File \"/usr/lib64/python2.7/site-packages/yaml/composer.py\", line 84, in compose_node\r\n    node = self.compose_mapping_node(anchor)\r\n  File \"/usr/lib64/python2.7/site-packages/yaml/composer.py\", line 133, in compose_mapping_node\r\n    item_value = self.compose_node(node, item_key)\r\n  File \"/usr/lib64/python2.7/site-packages/yaml/composer.py\", line 84, in compose_node\r\n    node = self.compose_mapping_node(anchor)\r\n  File \"/usr/lib64/python2.7/site-packages/yaml/composer.py\", line 127, in compose_mapping_node\r\n    while not self.check_event(MappingEndEvent):\r\n  File \"/usr/lib64/python2.7/site-packages/yaml/parser.py\", line 98, in check_event\r\n    self.current_event = self.state()\r\n  File \"/usr/lib64/python2.7/site-packages/yaml/parser.py\", line 439, in parse_block_mapping_key\r\n    \"expected <block end>, but found %r\" % token.id, token.start_mark)\r\nyaml.parser.ParserError: while parsing a block mapping\r\n  in \"<string>\", line 57, column 9:\r\n            region: \"infra\"\r\n            ^\r\nexpected <block end>, but found '<block mapping start>'\r\n  in \"<string>\", line 58, column 11:\r\n              containers:\r\n              ^\r\n", "msg": "MODULE FAILURE", "rc": 0}
        to retry, use: --limit @/usr/share/ansible/openshift-ansible/playbooks/byo/openshift-cluster/openshift-logging.retry


Expected results:

Additional info:

Comment 1 Anping Li 2017-10-13 07:40:32 UTC
Created attachment 1338111 [details]
The template file generate by playbooks

Comment 2 Jan Wozniak 2017-10-17 13:43:01 UTC
A variable value in ansible has to be properly quoted if contains space.

But there is another issue with the template, I incorrectly padded the section where nodeSelector gets populated. I will create a bugfix.

Comment 4 openshift-github-bot 2017-10-17 17:20:01 UTC
Commits pushed to master at https://github.com/openshift/openshift-ansible

https://github.com/openshift/openshift-ansible/commit/1f766eff01f6016a93fd72ee64cb09a8d54a52f1
Bug 1501768: fix eventrouter nodeSelector padding

https://github.com/openshift/openshift-ansible/commit/940b829df1c1adfbea80237f60dc196d5a5d2856
Merge pull request #5777 from wozniakjan/eventrouter_bug1501768

Bug 1501768: fix eventrouter nodeSelector padding

Comment 5 Anping Li 2017-10-19 14:00:34 UTC
The nodeSelector works with the fix. Waiting the RPM packages to verified that.

Comment 7 Anping Li 2017-10-23 04:04:46 UTC
Verified and pass with openshift-ansible-3.7.0-0.174.0

Comment 10 errata-xmlrpc 2017-11-28 22:16:57 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/RHSA-2017:3188


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