vmware-archive / ansible-aws-greengrass

ansible-greengrass is a set of automation to configure AWS Greengrass, an Internet of Things (IoT) toolkit and to deploy a Greengrass Core, the portion of Greengrass that runs in a local data center. This will enable VMware customers to rapidly deploy IoT
Other
14 stars 8 forks source link

Issue with jmespath parsing #6

Closed Kampe closed 5 years ago

Kampe commented 6 years ago

Hello!

I'm currently unable to run this playbook as I'm prompted with an error from jmespath:

TASK [greengrass-init : set greengrass_group_arn] ************************************************************************************************************************************** task path: /Users/user/Projects/ansible-greengrass/roles/greengrass-init/tasks/core.yml:8 fatal: [localhost]: FAILED! => { "msg": "JMESPathError in json_query filter plugin:\nExpecting: rbracket, got: unquoted_identifier: Parse error at column 18, token \"pi\" (UNQUOTED_IDENTIFIER), for expression:\n\"Groups[?Name=='[u'pi-1', u'pi-2', u'pi-3']'].Id | [0]\"\n ^" }

I've tried on multiple machines with the same output. Is there a reason I'm seeing this?

Kampe commented 6 years ago

few more details: pip list | grep Jinja2 Jinja2 2.10

pip list | grep jmespath jmespath 0.9.3

pip list | grep ansible ansible 2.4.3.0

huxoll commented 6 years ago

It looks like there's a list of greengrass groups as the value for greengrass_group_name, but at that point there should only be one. This code looping over the values in greengrass_group_names and running a create for each individual group, but it looks like something has gone wrong.

Can you supply your extra vars or however you are supplying the group names?

Also, we've only tested with ansible 2.5+. I'll check and see if I can reproduce with ansible 2.4.

huxoll commented 6 years ago

This does seem to be a problem only with Ansible 2.4 in my testing. We're using quite a few 2.5 constructs, it would be non-trivial to port back to 2.4. I recommend using Ansible 2.5 or greater.

huxoll commented 5 years ago

Calling this closed, we recommend Ansible 2.5+.