Hello,
I'm stuck and cannot find a solution :-/
I have some variables in host_vars folder:
links: "{{'1.1.1.2:8080,1.1.1.3:8080,1.1.1.4:8080'}}"
log: "{{'C:\\Program Files (x86)\\Test\\'}}"
My playbook looks like this:
- name: Test script
script: "{{ role_path }}/files/test.ps1 {{ links }} {{ log }}"
register: result
- set_fact: test="{{ result.stdout | from_json }}"
- name: Json output
local_action: copy content="{{ vars[item] }}"
dest="/home/user/ansible/test-{{ item }}-{{ ansible_date_time.date }}.json"
with_items:
- test
Error:
fatal: [test]: FAILED! => {
"changed": true,
"failed": 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:180\r\n+ ... 1.1.1.3:8080,1.1.1.4:8080
C:\\Program Files (x86)\\test ...\r\n+
~~~\r\n+ CategoryInfo : ObjectNotFound:
(x86:String) [], CommandNotFound \r\nException\r\n+ FullyQualifiedErrorId :
CommandNotFoundException\r\n",
"stdout": "",
"stdout_lines": []
}
Now without the log variable the powershell script works fine. Nothing
wrong with the script.
Ansible does not understand that var log is a path. I also tried removing
(x86) from the string, but then the result is 'C:\Program'. Space is
apparently a separator.
*Anybody knows how to write windows paths with spaces and characters? *
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/666a0f00-5bcb-453e-a479-c6691ed19b5b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.