--- argument_specs: main: short_description: Manage /etc/network/interfaces description: - >- Reads the interfaces file, renders it from C(network_interfaces_layout), and when the content differs backs up the current file, writes the new one, validates it and reloads. A failed validation restores the backup and fails the play. - Needs C(ifupdown2), because validation and reload use C(ifreload). options: network_interfaces_layout: type: dict default: {manual: [], bridges: []} description: - >- Desired network layout. The file is fully replaced with a loopback stanza, one C(iface inet manual) per C(manual) entry and one stanza per bridge. Both keys are optional when the variable is set. options: manual: type: list elements: str description: Interface names configured as C(inet manual), without C(auto). bridges: type: list elements: dict description: Bridges, rendered in order with C(auto ). options: name: type: str required: true description: Bridge name, for example C(vmbr0). method: type: str description: Address method. The template default is C(manual). With C(static), C(address) and C(netmask) are read unconditionally. address: type: raw description: >- IP address, only used when C(method) is C(static). Typed raw so that an inventory can template it, for example from C(ansible_host). netmask: type: str description: Netmask, only used when C(method) is C(static). gateway: type: str description: Default gateway, only used when C(method) is C(static) and the key is present. ports: type: str description: Value of C(bridge_ports). The template default is C(none). stp: type: str description: Value of C(bridge_stp). The template default is C(off). Quote C("off"), because unquoted YAML turns it into a boolean. fd: type: raw description: Value of C(bridge_fd), written only when C(stp) is not C(off). The template default is 2. vlan_aware: type: bool description: Adds C(bridge_vlan_aware yes) and C(bridge_vids). The template default is false. vlan_ids: type: str description: Value of C(bridge_vids) when C(vlan_aware) is true. The template default is C(2-4094). network_interfaces_file: type: path default: /etc/network/interfaces description: - File that is read, compared and rewritten. network_interfaces_backup: type: path default: /etc/network/interfaces.bak description: - Where the current file is copied before it is replaced, and restored from when validation fails. network_interfaces_validate_command: type: str default: ifreload -s -a description: - Command run after the new file is written, in syntax-check mode. A failure triggers the restore. network_interfaces_apply_command: type: str default: ifreload -a description: - Command run by the C(Reload Interfaces) handler, which the role flushes right after validation.