一、参数
msg:输出定义好的meassage 如果没有message 默认输出Hello world!
var:输出变量的内容 不可与msg选项共用
二、示例
- debug: msg="System {{ inventory_hostname }} has uuid {{ ansible_product_uuid }}"
- debug: msg="System {{ inventory_hostname }} has gateway {{ ansible_default_ipv4.gateway }}"
when: ansible_default_ipv4.gateway is defined
- shell: /usr/bin/uptime
register: result
- debug: var=result
- name: Display all variables/facts known for a host
debug: var=hostvars[inventory_hostname]
————Blueicex 2020/2/2 15:40 blueice1980@126.com
来源:CSDN
作者:blueicex2020
链接:https://blog.csdn.net/blueicex2017/article/details/104145525