Tearing my hair out trying to resolve this. I am getting the following:-
“reason”: “failed at splitting arguments, either an unbalanced jinja2 block or quotes: C:\‘Program Files’\IBM\SQLLIB\BIN\db2licm -a\n{{ temp_area }}\{{ db2_lic_file }}\n\nThe error appears to have been in ‘/var/lib/awx/projects/_49__ansible_chrisj_testing/playbooks/MQ_Test/Machine_Setup/roles/DB2_Install/tasks/Win32NT_DB2_Install.yml’: line 51, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name: Installing the license\n ^ here\n”
This is the errant piece of yaml:-
name: Installing the license
raw: |
C:'Program Files’\IBM\SQLLIB\BIN\db2licm -a
{{ temp_area }}{{ db2_lic_file }}
Probably not that, it seems to have understood the backslash. It is complaining about the “name:” line, so either there is an invisible character (happens when I cut/paste from a doc or web page), or likely the problem is before that line, so it is not expecting the ‘name:’ line. Can you show us the preceding few lines?
Not sure why it is complaining here, maybe an invisble control character. Anyway you are best off doing the following;
`
name: Installing the license
raw: ‘“C:\Program Files\IBM\SQLLIB\BIN\db2licm” -a “{{ temp_area }}{{ db2_lic_file }}”’
`
Raw in Windows is not truly raw as it is run in a PowerShell shell so the standard quoting rules apply. Having C:'Progam Files’.. wouldn’t work as that isn’t valid PowerShell. The example above will quote that whole string as well as your -a arg in case it has a space in it. You can also consider using win_command for this if you want to talk advantage of things like become, environment, async and some of the other options it adds.
Actually if your example is literal and -a is on a newline then that’s probably your issue, it sounds like you wanted ‘>’ not ‘|’ to folder each newline in your string but I still recommend the way above I posted.