让我们考虑以下命令:
command: "curl http://{{ my_server }}:1234/xaw?x={{ x }}&y={{ y }}&z={{ z }}""
如何将其写成多行,例如:
command:
"curl http://{{ my_server }}:1234/xaw?
x={{ x }}&
y={{ y }}&
z={{ z }}"
您可以在行尾附加一个“\”:
- hosts: all
tasks:
- set_fact:
my_server: "x"
ax: "x"
ay: "y"
az: "z"
- set_fact:
yourCommand: "curl http://{{ my_server }}:\
1234/xaw?x={{ ax }}\
&y={{ ay }}\
&z={{ az }}"
- debug:
var: yourCommand
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句