我尝试mosh_version
使用如下所示的ansible debug msg
命令打印先前注册的变量:
- name: Print mosh version
debug: msg="Mosh Version: {{ mosh_version.stdout }}"
它不起作用,并显示以下错误:
Note: The error may actually appear before this position: line 55, column 27
- name: Print mosh version
debug: msg="Mosh Version: {{ mosh_version.stdout }}"
^
We could be wrong, but this one looks like it might be an issue with
missing quotes. Always quote template expression brackets when they
start a value. For instance:
with_items:
- {{ foo }}
Should be written as:
with_items:
- "{{ foo }}"
我试过了
- name: Print mosh version
debug: msg=Mosh Version: "{{ mosh_version.stdout }}"
但这只会打印“ Mosh”。
使其运行的最佳方法是什么?
TASK: [ Print mosh version] ************************************** ok: [127.0.0.1] => { "msg": "Mosh" }