We can get facts (ansible_os_family
, ansible_pkg_mgr
) with Ad-Hoc command of setup module and filter.
ansible_os_family:
$ ansible all -m setup -a 'filter=ansible_os_family'
ra.local | SUCCESS => {
"ansible_facts": {
"ansible_os_family": "Debian"
},
"changed": false
}
ansible_pkg_mgr:
$ ansible all -m setup -a 'filter=ansible_pkg_mgr'
debian.local | SUCCESS => {
"ansible_facts": {
"ansible_pkg_mgr": "apt"
},
"changed": false
}