如何正确传递这些有几个双引号的参数?
tasks:
- name: Install McAfee tp
win_shell: |
D:\vra_install\AV\setupEP.exe ADDLOCAL="tp" INSTALLDIR="D:\Program Files" /qb /l"D:\temp\"
args:
executable: cmd
[root]# ansible-playbook mcafee-win-install.yml -e "host=prx103"
ERROR! failed at splitting arguments, either an unbalanced jinja2 block or quotes: D:\vra_install\AV\setupEP.exe ADDLOCAL="tp" INSTALLDIR="D:\Program Files" /qb /l"D:\temp\"
我尝试了win_package实现,但程序不想安装。我想论点没有被正确地通过。
- name: Install TP
win_package:
path: D:\vra_install\AV\setupEP.exe
arguments:
- ADDLOCAL="tp"
- INSTALLDIR="D:\Program Files"
- /qb
- /l"D:\temp\" '
creates_path: D:\Program Files\McAfee\Endpoint Security\Threat Prevention\AMCore
creates_service: mfevtp
state: present
fatal: [veaprdprx103]: FAILED! => {
"changed": false,
"msg": "unexpected rc from install D:\\vra_install\\AV\\setupEP.exe: see rc, stdout and stderr for more details",
"rc": 16019,
"reboot_required": false,
"stderr": "",
"stderr_lines": [],
"stdout": "",
"stdout_lines": []
谢谢。
发布于 2022-05-20 15:53:39
我会尝试使用单引号作为完整的字符串。
例如:
tasks:
- name: Install McAfee tp.
win_shell: |
'D:\vra_install\AV\setupEP.exe ADDLOCAL="tp" INSTALLDIR="D:\Program Files" /qb /l"D:\temp\"'
args:
executable: cmd
https://stackoverflow.com/questions/72319136
复制相似问题