0

I am writing a script that will allow my deployments to return a checksum for nexus artifacts deployment. Everything under the when: condition is new to the script. There are variables that aren't defined here, such as checksum, but I put a default filter on it so that Ansible can still use a variable if it can't find a value.

with_indexed_items: app_deployments.keys()|sort
when: |
    deploy_results.results[item.0].md5sum|d().local|d()|match(nx_app_deployments[item.1].checksum|d(deploy_results.results[item.0].md5sum)

Unfortunately I keep getting hit with this error (most probably due to syntax).

Error: TASK: [nexusArtifacts | STAGE | Stage deployments] ****************************
fatal: [ari001-app1] => Failed to template {% if deploy_results.results[item.0].md5sum|d().local|d()|match(nx_app_deployments[i                                                                                tem.1].checksum|d(deploy_results.results[item.0].md5sum) and
stageNexus|d()|bool and
app_deployments[item.1].name is defined and
app_deployments[item.1].active|d(1)|bool and
deploy_toggles|d({})[item.1]|d(1)|bool and
(item in eapDeployList|d(item.1) or 'all' in eapDeployList|d(item)) and
(app != 'springBatch' or
    item in sbDeployList|d(item.1)|listParse) and
item in key_list|d([item.1])
 %} True {% else %} False {% endif %}: template error while templating string: unexpected "}", expected ")"

FATAL: all hosts have already failed -- aborting

Any help on this would be greatly appreciated. Much thanks!

J. Patwary
  • 427
  • 1
  • 7
  • 22

1 Answers1

0

Your match( is not terminated by )

Andrew
  • 3,912
  • 17
  • 28