Hi,
My playbook is not working anymore after updating ansible to latest version.
For example:
-
Vault file containing variable with value
vault_win_password: foo20"
-
Variable with value
location: C:\Program files (x86)\bar
Task:
`
- name: Test login
script: “{{ role_path }}/files/portal.ps1 {{ dbuser }} {{ vault_win_password }}”
`
Error:
`
The full traceback is:
Traceback (most recent call last):
File “/usr/local/lib/python2.7/dist-packages/ansible-2.5.1-py2.7.egg/ansible/executor/task_executor.py”, line 138, in run
res = self._execute()
File “/usr/local/lib/python2.7/dist-packages/ansible-2.5.1-py2.7.egg/ansible/executor/task_executor.py”, line 558, in _execute
result = self._handler.run(task_vars=variables)
File “/usr/local/lib/python2.7/dist-packages/ansible-2.5.1-py2.7.egg/ansible/plugins/action/script.py”, line 79, in run
parts = [to_text(s, errors=‘surrogate_or_strict’) for s in shlex.split(raw_params.strip())]
File “/usr/lib/python2.7/shlex.py”, line 279, in split
return list(lex)
File “/usr/lib/python2.7/shlex.py”, line 269, in next
token = self.get_token()
File “/usr/lib/python2.7/shlex.py”, line 96, in get_token
raw = self.read_token()
File “/usr/lib/python2.7/shlex.py”, line 172, in read_token
raise ValueError, “No closing quotation”
ValueError: No closing quotation
fatal: [sj-aio01]: FAILED! => {
“msg”: “Unexpected failure during module execution.”,
“stdout”: “”
}
`
`
- name: Test location
script: “{{ role_path }}/files/file.ps1 {{ location}}”
`
`
fatal: [sj-can02]: FAILED! => {
“changed”: true,
“msg”: “non-zero return code”,
“rc”: 1,
“stderr”: “x86 : The term ‘x86’ is not recognized as the name of a cmdlet, function, \r\nscript file, or operable program. Check the spelling of the name, or if a path \r\nwas included, verify that the path is correct and try again.\r\nAt line:1 char:122\r\n+ … 42148.17-152711404220483\cannister.ps1’ C:\Program Files (x86)\IBM\IB …\r\n+ ~~~\r\n + CategoryInfo : ObjectNotFound: (x86:String) , CommandNotFound \r\n Exception\r\n + FullyQualifiedErrorId : CommandNotFoundException\r\n \r\n\r\n”,
“stdout”: “”,
“stdout_lines”:
}
`
Before updating this worked.
`
- name: Test location
script: “{{ role_path }}/files/file.ps1 '{{ location}}'”
`
Now says:
`
ERROR! Syntax Error while loading YAML.
found unknown escape character “'”
`
How am I supposed to pass along parameters when ansible does not understand the values anymore?