У меня есть книга воспроизведения, чтобы загрузить файл на удаленный хост Windows и затем выполнить его.Проблема в том, что у меня есть пробелы в пути, и Playbook не удается выполнить «Выполнить файл».Вот playbook:
- name: Copy file and run
hosts: terminals
tasks:
- name: Copy a single file
win_copy:
src: '/tmp/ASDTech Shell Terminal Setup 4.0.0.exe'
dest: 'C:\Temp\ASDTech Shell Terminal Setup 4.0.0.exe'
- name: Check if file exist
win_stat:
path: 'C:\Temp\ASDTech Shell Terminal Setup 4.0.0.exe'
register: file_info
- name: Execute file
raw: 'C:\Temp\ASDTech Shell Terminal Setup 4.0.0.exe'
when: file_info.stat.exists == True
Ошибка:
TASK [Execute file] *************************************************************************************************************************************************************************************************************************
fatal: [50.18.46.45]: FAILED! => {"changed": true, "msg": "non-zero return code", "rc": 1, "stderr": "C:\\\\Temp\\\\ASDTech : The term 'C:\\\\Temp\\\\ASDTech' is not recognized as the name of a cmdlet, function, script file, or \r\noperable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try \r\nagain.\r\nAt line:1 char:1\r\n+ C:\\\\Temp\\\\ASDTech Shell Terminal Setup 4.0.0.exe\r\n+ ~~~~~~~~~~~~~~~~\r\n + CategoryInfo : ObjectNotFound: (C:\\\\Temp\\\\ASDTech:String) [], CommandNotFoundException\r\n + FullyQualifiedErrorId : CommandNotFoundException\r\n ", "stderr_lines": ["C:\\\\Temp\\\\ASDTech : The term 'C:\\\\Temp\\\\ASDTech' is not recognized as the name of a cmdlet, function, script file, or ", "operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try ", "again.", "At line:1 char:1", "+ C:\\\\Temp\\\\ASDTech Shell Terminal Setup 4.0.0.exe", "+ ~~~~~~~~~~~~~~~~", " + CategoryInfo : ObjectNotFound: (C:\\\\Temp\\\\ASDTech:String) [], CommandNotFoundException", " + FullyQualifiedErrorId : CommandNotFoundException", " "], "stdout": "", "stdout_lines": []}
Может кто-нибудь подсказать мне, какой модуль использовать, или как переписать задачу «Выполнить файл», чтобы правильно обрабатывать путь спространства.