参考文章:https://www.middlewareinventory.com/blog/ansible-facts-list-how-to-use-ansible-facts/
常用指令:
ansible <hostname (or) hostgroup> -m setup
本地测试指令如:
ansible -i deploy/profiles/ha/hosts config -u root --key-file ~/.ssh/build.key -m setup
Ansible Gathered Facts or playbook variables belongs to one of the following types
Dictionary:{{ansible_apparmor.status}}
List:{{ansible_all_ipv4_addresses[1]}} (不带[1]会返回整个list内容)
AnsibleUnsafeText:{{ ansible_architecture }}
测试variable类型:{{ <the variable name> | type_debug }}