Hello Gurus,
I have been banging my head against the wall about this issue. With the variable below:
serviceinstaller_deployment_details:
- {
“service_name”: “cardmanagement”,
“artifact_location”: “{{ javamicroapp_deployment_details[0].folder_path }}”,
“service_artifact_commands”: [
“-Dproperties.path={{ appcardman_deployment_details[1].dest }}”,
“-Dlocale.path={{ appcardman_deployment_details[0].dest }}”,
“-Dlogging.config={{ appcardman_deployment_details[1].dest }}/logback.xml”,
“{{ javamicroapp_deployment_details[0].artifact_name }}”
]
}
I am trying to iterate over the service_artifact_command using a join(" ") to produce one line of commands and it keeps complaining about an undefined error. With or without a single quotes around the square brackets. Kindly find the full snippet at pastbin.com .
I have switched from this to map, using with_dict iterating over item.value. Map looks like shown below:
serviceinstaller_deployment_details:
cardman:
service_name: “cardmanagement”
artifact_location: “{{ javamicroapp_deployment_details[0].folder_path }}”
service_artifact_commands:
- “-Dproperties.path={{ appcardman_deployment_details[1].dest }}”
- “-Dlocale.path={{ appcardman_deployment_details[0].dest }}”
- “-Dlogging.config={{ appcardman_deployment_details[1].dest }}/logback.xml”
- “{{ javamicroapp_deployment_details[0].artifact_name }}”
using map I get the error : fatal: [10.40.14.95]: FAILED! => {“failed”: true, “msg”: “with_dict expects a dict”}
Can anyone point out what I am actually doing wrong? I can confirm that service_name and artifact_location values are used as expected.
Best Regards,