Hardware Facts¶
block_devices
¶
host.fact.block_devices
Returns a dict of (mounted) block devices:
{
'/dev/sda1': {
'available': '39489508',
'used_percent': '3',
'mount': '/',
'used': '836392',
'blocks': '40325900'
},
}
ipv4_addresses
¶
host.fact.ipv4_addresses
Gets & returns a dictionary of network interface -> IPv4 address.
{
'eth0': '127.0.0.1',
}
Warning
This fact is deprecated, please use the ipv4_addrs
fact.
Note
Network interfaces with no IPv4 will not be part of the dictionary.
ipv4_addrs
¶
host.fact.ipv4_addrs
Gets & returns a dictionary of network interface -> list of IPv4 addresses.
{
'eth0': ['127.0.0.1'],
}
Note
Network interfaces with no IPv4 will not be part of the dictionary.
ipv6_addresses
¶
host.fact.ipv6_addresses
Gets & returns a dictionary of network interface -> IPv6 address.
{
'eth0': 'fe80::a00:27ff::2',
}
Warning
This fact is deprecated, please use the ipv6_addrs
fact.
Note
Network interfaces with no IPv6 will not be part of the dictionary.
ipv6_addrs
¶
host.fact.ipv6_addrs
Gets & returns a dictionary of network interface -> list of IPv6 addresses.
{
'eth0': ['fe80::a00:27ff::2'],
}
Note
Network interfaces with no IPv6 will not be part of the dictionary.
network_devices
¶
host.fact.network_devices
Gets & returns a dict of network devices. See the ipv4_addresses
and
ipv6_addresses
facts for easier-to-use shortcuts to get device addresses.
{
'eth0': {
'ipv4': {
'address': '127.0.0.1',
'broadcast': '127.0.0.13',
# Only one of these will exist:
'netmask': '255.255.255.255',
'mask_bits': 32,
},
'ipv6': {
'address': 'fe80::a00:27ff:fec3:36f0',
'mask_bits': 64,
'additional_ips': [{
'address': 'fe80::',
'mask_bits': 128,
}],
}
},
}