可以通过 ansible 127.0.0.1 -m setup
查看支持的内置变量
- hosts: 127.0.0.1
tasks:
- name: debug
debug:
msg: "hostname: {{ ansible_hostname }} ip:{{ ansible_host }} {{ ansible_memtotal_mb }} {{ ansible_processor_vcpus }}"
标签:内置,变量,0.1,hostname,127.0,ansible,playbook
From: https://www.cnblogs.com/wangend/p/17061551.html