ansible.network_facts(3) - Linux man page

Name

network_facts - Gather facts from DNS and a network inventory file

Description

This module gathers facts for a specific system using DNS and a separate network inventory YAML file. The host's IP address is matched with a given network range and the variables listed as part of this network range are automatically set for this hosts.

Using this module you can separate network-related settings per network (e.g. using different DNS servers, NTP servers, or even software distribution or provisioning servers based on the location of the network.

This module requires the netaddr python module.

Options

host

The host to use for gathering network-related facts.(required)

full

A boolean to decide whether a second DNS lookup is needed for the FQDN.

inventory
The inventory file consisting of network-related facts. (default: /etc/ansible/network-inventory.yml)
gateway
The gateway strategy if no gateway was defined in the inventory.Either 'first', 'last' or 'none'This is useful if you have a standardized way of defining the gateway in your organization. (default: last)."

Notes

This module ought to be run from a system that can access the DNS interface directly, either by using local_action or using delegate_to.

Examples

local_action: network_facts host=$inventory_hostname inventory=network-inventory.yml

Author

Dag Wieers

See Also

ansible(1), http://ansible.github.com/modules.html#network-facts