Quick Ref Ansible Facts
A quick reminder of the Ansible facts of an host you can get (for linux, the windows one are different).
Run the command ansible localhost -m setup
localhost | SUCCESS => {
"ansible_facts": {
"ansible_all_ipv4_addresses": [
"10.0.2.15",
"192.168.56.102"
],
"ansible_all_ipv6_addresses": [
"fe80::2e01:b725:f058:57fd",
"fe80::a00:27ff:fe2f:895e"
],
"ansible_apparmor": {
"status": "disabled"
},
"ansible_architecture": "x86_64",
"ansible_bios_date": "12/01/2006",
"ansible_bios_version": "VirtualBox",
"ansible_cmdline": {
"BOOT_IMAGE": "/vmlinuz-3.10.0-693.21.1.el7.x86_64",
"LANG": "en_US.UTF-8",
"crashkernel": "auto",
"quiet": true,
"rd.lvm.lv": "centos/swap",
"rhgb": true,
"ro": true,
"root": "/dev/mapper/centos-root"
},
"ansible_date_time": {
"date": "2018-08-20",
"day": "20",
"epoch": "1534757463",
"hour": "09",
"iso8601": "2018-08-20T09:31:03Z",
"iso8601_basic": "20180820T093103213082",
"iso8601_basic_short": "20180820T093103",
"iso8601_micro": "2018-08-20T09:31:03.213214Z",
"minute": "31",
"month": "08",
"second": "03",
"time": "09:31:03",
"tz": "UTC",
"tz_offset": "+0000",
"weekday": "Monday",
"weekday_number": "1",
"weeknumber": "34",
"year": "2018"
},
"ansible_default_ipv4": {
"address": "10.0.2.15",
"alias": "enp0s3",
"broadcast": "10.0.2.255",
"gateway": "10.0.2.2",
"interface": "enp0s3",
"macaddress": "08:00:27:11:ad:d2",
"mtu": 1500,
"netmask": "255.255.255.0",
"network": "10.0.2.0",
"type": "ether"
},
"ansible_default_ipv6": {},
"ansible_device_links": {
"ids": {
"dm-0": [
"dm-name-centos-root",
"dm-uuid-LVM-zPbJxMoXzwN54pCQd1xMKjSffVPCZ1eySIKUVXGVSzez3P8
],
"dm-1": [
"dm-name-centos-swap",
"dm-uuid-LVM-zPbJxMoXzwN54pCQd1xMKjSffVPCZ1eyfpmZUc5BfgVd4qa
],
"dm-2": [
"dm-name-centos-home",
"dm-uuid-LVM-zPbJxMoXzwN54pCQd1xMKjSffVPCZ1ey2Oed3uxDlvYScio
],
"sda": [
"ata-VBOX_HARDDISK_VBb46354d3-8ec27bde"
],
"sda1": [
"ata-VBOX_HARDDISK_VBb46354d3-8ec27bde-part1"
],
"sda2": [
"ata-VBOX_HARDDISK_VBb46354d3-8ec27bde-part2",
"lvm-pv-uuid-1s5MWk-HhGy-lUHo-CIj5-Fd9e-8dWv-FJXO7c"
]
},
"labels": {},
"masters": {
"sda2": [
"dm-0",
"dm-1",
"dm-2"
]
},
"uuids": {
"dm-0": [
"ddd13445-3f39-4393-b903-0ff187f7cf6b"
],
"dm-1": [
"1d86da61-6a50-490d-8b80-969fcf391f4c"
],
"dm-2": [
"1cdc35a1-9e9a-4e8c-b46b-6181b3e4a2b1"
],
"sda1": [
"6bd03c61-c02b-4d0f-9951-1c0c84c784d8"
]
}
},
"ansible_devices": {
"dm-0": {
"holders": [],
"host": "",
"links": {
"ids": [
"dm-name-centos-root",
"dm-uuid-LVM-zPbJxMoXzwN54pCQd1xMKjSffVPCZ1eySIKUVXGVSze
],
"labels": [],
"masters": [],
"uuids": [
"ddd13445-3f39-4393-b903-0ff187f7cf6b"
]
},
"model": null,
"partitions": {},
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "",
"sectors": "85950464",
"sectorsize": "512",
"size": "40.98 GB",
"support_discard": "0",
"vendor": null,
"virtual": 1
},
"dm-1": {
"holders": [],
"host": "",
"links": {
"ids": [
"dm-name-centos-swap",
"dm-uuid-LVM-zPbJxMoXzwN54pCQd1xMKjSffVPCZ1eyfpmZUc5BfgV
],
"labels": [],
"masters": [],
"uuids": [
"1d86da61-6a50-490d-8b80-969fcf391f4c"
]
},
"model": null,
"partitions": {},
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "",
"sectors": "4194304",
"sectorsize": "512",
"size": "2.00 GB",
"support_discard": "0",
"vendor": null,
"virtual": 1
},
"dm-2": {
"holders": [],
"host": "",
"links": {
"ids": [
"dm-name-centos-home",
"dm-uuid-LVM-zPbJxMoXzwN54pCQd1xMKjSffVPCZ1ey2Oed3uxDlvY
],
"labels": [],
"masters": [],
"uuids": [
"1cdc35a1-9e9a-4e8c-b46b-6181b3e4a2b1"
]
},
"model": null,
"partitions": {},
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "",
"sectors": "41959424",
"sectorsize": "512",
"size": "20.01 GB",
"support_discard": "0",
"vendor": null,
"virtual": 1
},
"sda": {
"holders": [],
"host": "",
"links": {
"ids": [
"ata-VBOX_HARDDISK_VBb46354d3-8ec27bde"
],
"labels": [],
"masters": [],
"uuids": []
},
"model": "VBOX HARDDISK",
"partitions": {
"sda1": {
"holders": [],
"links": {
"ids": [
"ata-VBOX_HARDDISK_VBb46354d3-8ec27bde-part1"
],
"labels": [],
"masters": [],
"uuids": [
"6bd03c61-c02b-4d0f-9951-1c0c84c784d8"
]
},
"sectors": "2097152",
"sectorsize": 512,
"size": "1.00 GB",
"start": "2048",
"uuid": "6bd03c61-c02b-4d0f-9951-1c0c84c784d8"
},
"sda2": {
"holders": [
"centos-root",
"centos-swap",
"centos-home"
],
"links": {
"ids": [
"ata-VBOX_HARDDISK_VBb46354d3-8ec27bde-part2",
"lvm-pv-uuid-1s5MWk-HhGy-lUHo-CIj5-Fd9e-8dWv-FJX
],
"labels": [],
"masters": [
"dm-0",
"dm-1",
"dm-2"
],
"uuids": []
},
"sectors": "132118528",
"sectorsize": 512,
"size": "63.00 GB",
"start": "2099200",
"uuid": null
}
},
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "cfq",
"sectors": "134217728",
"sectorsize": "512",
"size": "64.00 GB",
"support_discard": "0",
"vendor": "ATA",
"virtual": 1
}
},
"ansible_distribution": "CentOS",
"ansible_distribution_file_parsed": true,
"ansible_distribution_file_path": "/etc/redhat-release",
"ansible_distribution_file_variety": "RedHat",
"ansible_distribution_major_version": "7",
"ansible_distribution_release": "Core",
"ansible_distribution_version": "7.4.1708",
"ansible_dns": {
"nameservers": [
"10.0.2.3"
],
"options": {
"single-request-reopen": true
}
},
"ansible_domain": "",
"ansible_effective_group_id": 1000,
"ansible_effective_user_id": 1000,
"ansible_enp0s3": {
"active": true,
"device": "enp0s3",
"features": {
"busy_poll": "off [fixed]",
"fcoe_mtu": "off [fixed]",
"generic_receive_offload": "on",
"generic_segmentation_offload": "on",
"highdma": "off [fixed]",
"hw_tc_offload": "off [fixed]",
"l2_fwd_offload": "off [fixed]",
"large_receive_offload": "off [fixed]",
"loopback": "off [fixed]",
"netns_local": "off [fixed]",
"ntuple_filters": "off [fixed]",
"receive_hashing": "off [fixed]",
"rx_all": "off",
"rx_checksumming": "off",
"rx_fcs": "off",
"rx_vlan_filter": "on [fixed]",
"rx_vlan_offload": "on",
"rx_vlan_stag_filter": "off [fixed]",
"rx_vlan_stag_hw_parse": "off [fixed]",
"scatter_gather": "on",
"tcp_segmentation_offload": "on",
"tx_checksum_fcoe_crc": "off [fixed]",
"tx_checksum_ip_generic": "on",
"tx_checksum_ipv4": "off [fixed]",
"tx_checksum_ipv6": "off [fixed]",
"tx_checksum_sctp": "off [fixed]",
"tx_checksumming": "on",
"tx_fcoe_segmentation": "off [fixed]",
"tx_gre_csum_segmentation": "off [fixed]",
"tx_gre_segmentation": "off [fixed]",
"tx_gso_partial": "off [fixed]",
"tx_gso_robust": "off [fixed]",
"tx_ipip_segmentation": "off [fixed]",
"tx_lockless": "off [fixed]",
"tx_mpls_segmentation": "off [fixed]",
"tx_nocache_copy": "off",
"tx_scatter_gather": "on",
"tx_scatter_gather_fraglist": "off [fixed]",
"tx_sctp_segmentation": "off [fixed]",
"tx_sit_segmentation": "off [fixed]",
"tx_tcp6_segmentation": "off [fixed]",
"tx_tcp_ecn_segmentation": "off [fixed]",
"tx_tcp_mangleid_segmentation": "off",
"tx_tcp_segmentation": "on",
"tx_udp_tnl_csum_segmentation": "off [fixed]",
"tx_udp_tnl_segmentation": "off [fixed]",
"tx_vlan_offload": "on [fixed]",
"tx_vlan_stag_hw_insert": "off [fixed]",
"udp_fragmentation_offload": "off [fixed]",
"vlan_challenged": "off [fixed]"
},
"hw_timestamp_filters": [],
"ipv4": {
"address": "10.0.2.15",
"broadcast": "10.0.2.255",
"netmask": "255.255.255.0",
"network": "10.0.2.0"
},
"ipv6": [
{
"address": "fe80::2e01:b725:f058:57fd",
"prefix": "64",
"scope": "link"
}
],
"macaddress": "08:00:27:11:ad:d2",
"module": "e1000",
"mtu": 1500,
"pciid": "0000:00:03.0",
"promisc": false,
"speed": 1000,
"timestamping": [
"tx_software",
"rx_software",
"software"
],
"type": "ether"
},
"ansible_enp0s8": {
"active": true,
"device": "enp0s8",
"features": {
"busy_poll": "off [fixed]",
"fcoe_mtu": "off [fixed]",
"generic_receive_offload": "on",
"generic_segmentation_offload": "on",
"highdma": "off [fixed]",
"hw_tc_offload": "off [fixed]",
"l2_fwd_offload": "off [fixed]",
"large_receive_offload": "off [fixed]",
"loopback": "off [fixed]",
"netns_local": "off [fixed]",
"ntuple_filters": "off [fixed]",
"receive_hashing": "off [fixed]",
"rx_all": "off",
"rx_checksumming": "off",
"rx_fcs": "off",
"rx_vlan_filter": "on [fixed]",
"rx_vlan_offload": "on",
"rx_vlan_stag_filter": "off [fixed]",
"rx_vlan_stag_hw_parse": "off [fixed]",
"scatter_gather": "on",
"tcp_segmentation_offload": "on",
"tx_checksum_fcoe_crc": "off [fixed]",
"tx_checksum_ip_generic": "on",
"tx_checksum_ipv4": "off [fixed]",
"tx_checksum_ipv6": "off [fixed]",
"tx_checksum_sctp": "off [fixed]",
"tx_checksumming": "on",
"tx_fcoe_segmentation": "off [fixed]",
"tx_gre_csum_segmentation": "off [fixed]",
"tx_gre_segmentation": "off [fixed]",
"tx_gso_partial": "off [fixed]",
"tx_gso_robust": "off [fixed]",
"tx_ipip_segmentation": "off [fixed]",
"tx_lockless": "off [fixed]",
"tx_mpls_segmentation": "off [fixed]",
"tx_nocache_copy": "off",
"tx_scatter_gather": "on",
"tx_scatter_gather_fraglist": "off [fixed]",
"tx_sctp_segmentation": "off [fixed]",
"tx_sit_segmentation": "off [fixed]",
"tx_tcp6_segmentation": "off [fixed]",
"tx_tcp_ecn_segmentation": "off [fixed]",
"tx_tcp_mangleid_segmentation": "off",
"tx_tcp_segmentation": "on",
"tx_udp_tnl_csum_segmentation": "off [fixed]",
"tx_udp_tnl_segmentation": "off [fixed]",
"tx_vlan_offload": "on [fixed]",
"tx_vlan_stag_hw_insert": "off [fixed]",
"udp_fragmentation_offload": "off [fixed]",
"vlan_challenged": "off [fixed]"
},
"hw_timestamp_filters": [],
"ipv4": {
"address": "192.168.56.102",
"broadcast": "192.168.56.255",
"netmask": "255.255.255.0",
"network": "192.168.56.0"
},
"ipv6": [
{
"address": "fe80::a00:27ff:fe2f:895e",
"prefix": "64",
"scope": "link"
}
],
"macaddress": "08:00:27:2f:89:5e",
"module": "e1000",
"mtu": 1500,
"pciid": "0000:00:08.0",
"promisc": false,
"speed": 1000,
"timestamping": [
"tx_software",
"rx_software",
"software"
],
"type": "ether"
},
"ansible_env": {
"HISTCONTROL": "ignoredups",
"HISTSIZE": "1000",
"HOME": "/home/vagrant",
"HOSTNAME": "nfsclient",
"LANG": "en_US.UTF-8",
"LESSOPEN": "||/usr/bin/lesspipe.sh %s",
"LOGNAME": "vagrant",
"LS_COLORS": "rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;3=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:1:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=1;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.x.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=0;36:*.spx=01;36:*.xspf=01;36:",
"MAIL": "/var/spool/mail/vagrant",
"PATH": "/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/vag
"PWD": "/home/vagrant",
"SELINUX_LEVEL_REQUESTED": "",
"SELINUX_ROLE_REQUESTED": "",
"SELINUX_USE_CURRENT_RANGE": "",
"SHELL": "/bin/bash",
"SHLVL": "3",
"SSH_CLIENT": "10.0.2.2 33473 22",
"SSH_CONNECTION": "10.0.2.2 33473 10.0.2.15 22",
"SSH_TTY": "/dev/pts/0",
"TERM": "xterm",
"USER": "vagrant",
"XDG_RUNTIME_DIR": "/run/user/1000",
"XDG_SESSION_ID": "7",
"_": "/usr/bin/python2"
},
"ansible_fips": false,
"ansible_form_factor": "Other",
"ansible_fqdn": "nfsclient",
"ansible_hostname": "nfsclient",
"ansible_interfaces": [
"lo",
"enp0s3",
"enp0s8"
],
"ansible_kernel": "3.10.0-693.21.1.el7.x86_64",
"ansible_lo": {
"active": true,
"device": "lo",
"features": {
"busy_poll": "off [fixed]",
"fcoe_mtu": "off [fixed]",
"generic_receive_offload": "on",
"generic_segmentation_offload": "on",
"highdma": "on [fixed]",
"hw_tc_offload": "off [fixed]",
"l2_fwd_offload": "off [fixed]",
"large_receive_offload": "off [fixed]",
"loopback": "on [fixed]",
"netns_local": "on [fixed]",
"ntuple_filters": "off [fixed]",
"receive_hashing": "off [fixed]",
"rx_all": "off [fixed]",
"rx_checksumming": "on [fixed]",
"rx_fcs": "off [fixed]",
"rx_vlan_filter": "off [fixed]",
"rx_vlan_offload": "off [fixed]",
"rx_vlan_stag_filter": "off [fixed]",
"rx_vlan_stag_hw_parse": "off [fixed]",
"scatter_gather": "on",
"tcp_segmentation_offload": "on",
"tx_checksum_fcoe_crc": "off [fixed]",
"tx_checksum_ip_generic": "on [fixed]",
"tx_checksum_ipv4": "off [fixed]",
"tx_checksum_ipv6": "off [fixed]",
"tx_checksum_sctp": "on [fixed]",
"tx_checksumming": "on",
"tx_fcoe_segmentation": "off [fixed]",
"tx_gre_csum_segmentation": "off [fixed]",
"tx_gre_segmentation": "off [fixed]",
"tx_gso_partial": "off [fixed]",
"tx_gso_robust": "off [fixed]",
"tx_ipip_segmentation": "off [fixed]",
"tx_lockless": "on [fixed]",
"tx_mpls_segmentation": "off [fixed]",
"tx_nocache_copy": "off [fixed]",
"tx_scatter_gather": "on [fixed]",
"tx_scatter_gather_fraglist": "on [fixed]",
"tx_sctp_segmentation": "on",
"tx_sit_segmentation": "off [fixed]",
"tx_tcp6_segmentation": "on",
"tx_tcp_ecn_segmentation": "on",
"tx_tcp_mangleid_segmentation": "on",
"tx_tcp_segmentation": "on",
"tx_udp_tnl_csum_segmentation": "off [fixed]",
"tx_udp_tnl_segmentation": "off [fixed]",
"tx_vlan_offload": "off [fixed]",
"tx_vlan_stag_hw_insert": "off [fixed]",
"udp_fragmentation_offload": "on",
"vlan_challenged": "on [fixed]"
},
"hw_timestamp_filters": [],
"ipv4": {
"address": "127.0.0.1",
"broadcast": "host",
"netmask": "255.0.0.0",
"network": "127.0.0.0"
},
"ipv6": [
{
"address": "::1",
"prefix": "128",
"scope": "host"
}
],
"mtu": 65536,
"promisc": false,
"timestamping": [
"rx_software",
"software"
],
"type": "loopback"
},
"ansible_local": {},
"ansible_lsb": {},
"ansible_machine": "x86_64",
"ansible_machine_id": "0fb1a22b768f453397e321fe9954a766",
"ansible_memfree_mb": 715,
"ansible_memory_mb": {
"nocache": {
"free": 820,
"used": 194
},
"real": {
"free": 715,
"total": 1014,
"used": 299
},
"swap": {
"cached": 0,
"free": 2047,
"total": 2047,
"used": 0
}
},
"ansible_memtotal_mb": 1014,
"ansible_mounts": [
{
"block_available": 10421037,
"block_size": 4096,
"block_total": 10738562,
"block_used": 317525,
"device": "/dev/mapper/centos-root",
"fstype": "xfs",
"inode_available": 21449007,
"inode_total": 21487616,
"inode_used": 38609,
"mount": "/",
"options": "rw,seclabel,relatime,attr2,inode64,noquota",
"size_available": 42684567552,
"size_total": 43985149952,
"uuid": "ddd13445-3f39-4393-b903-0ff187f7cf6b"
},
{
"block_available": 5233989,
"block_size": 4096,
"block_total": 5242367,
"block_used": 8378,
"device": "/dev/mapper/centos-home",
"fstype": "xfs",
"inode_available": 10489829,
"inode_total": 10489856,
"inode_used": 27,
"mount": "/home",
"options": "rw,seclabel,relatime,attr2,inode64,noquota",
"size_available": 21438418944,
"size_total": 21472735232,
"uuid": "1cdc35a1-9e9a-4e8c-b46b-6181b3e4a2b1"
},
{
"block_available": 220525,
"block_size": 4096,
"block_total": 259584,
"block_used": 39059,
"device": "/dev/sda1",
"fstype": "xfs",
"inode_available": 523955,
"inode_total": 524288,
"inode_used": 333,
"mount": "/boot",
"options": "rw,seclabel,relatime,attr2,inode64,noquota",
"size_available": 903270400,
"size_total": 1063256064,
"uuid": "6bd03c61-c02b-4d0f-9951-1c0c84c784d8"
}
],
"ansible_nodename": "nfsclient",
"ansible_os_family": "RedHat",
"ansible_pkg_mgr": "yum",
"ansible_processor": [
"0",
"GenuineIntel",
"Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz"
],
"ansible_processor_cores": 1,
"ansible_processor_count": 1,
"ansible_processor_threads_per_core": 1,
"ansible_processor_vcpus": 1,
"ansible_product_name": "VirtualBox",
"ansible_product_serial": "NA",
"ansible_product_uuid": "NA",
"ansible_product_version": "1.2",
"ansible_python": {
"executable": "/usr/bin/python2",
"has_sslcontext": true,
"type": "CPython",
"version": {
"major": 2,
"micro": 5,
"minor": 7,
"releaselevel": "final",
"serial": 0
},
"version_info": [
2,
7,
5,
"final",
0
]
},
"ansible_python_version": "2.7.5",
"ansible_real_group_id": 1000,
"ansible_real_user_id": 1000,
"ansible_selinux": {
"config_mode": "permissive",
"mode": "permissive",
"policyvers": 28,
"status": "enabled",
"type": "targeted"
},
"ansible_selinux_python_present": true,
"ansible_service_mgr": "systemd",
"ansible_ssh_host_key_ecdsa_public": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAA
"ansible_ssh_host_key_ed25519_public": "AAAAC3NzaC1lZDI1NTE5AAAAIFuT/8sN
"ansible_ssh_host_key_rsa_public": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDHglYKGMXoUWgTRf/AvssxXainh2grQj5rmmBHSBXTB5nzjPvoR/Q/x5yZu8VNT0ZVndVi8nXnNh4uK8cwbnwE
"ansible_swapfree_mb": 2047,
"ansible_swaptotal_mb": 2047,
"ansible_system": "Linux",
"ansible_system_capabilities": [
""
],
"ansible_system_capabilities_enforced": "True",
"ansible_system_vendor": "innotek GmbH",
"ansible_uptime_seconds": 19741,
"ansible_user_dir": "/home/vagrant",
"ansible_user_gecos": "vagrant",
"ansible_user_gid": 1000,
"ansible_user_id": "vagrant",
"ansible_user_shell": "/bin/bash",
"ansible_user_uid": 1000,
"ansible_userspace_architecture": "x86_64",
"ansible_userspace_bits": "64",
"ansible_virtualization_role": "guest",
"ansible_virtualization_type": "virtualbox",
"gather_subset": [
"all"
],
"module_setup": true
},
"changed": false
}