Default variables

Basic options

ifupdown

Should Ansible manage /etc/network/interfaces? Set to False to disable.

ifupdown: True
ifupdown_packages

List of network-related packages to install. Other packages might be installed as needed.

ifupdown_packages: [ 'resolvconf' ]

Configuration overrides

ifupdown_ignore_cap12s

Force network configuration even if POSIX capabilities tell otherwise.

ifupdown_ignore_cap12s: False
ifupdown_ignore_static

Should the debops.ifupdown role ignore static configuration in /etc/network/interfaces? This might result in loss of connectivity if your interfaces are not configured properly. Use with caution!

ifupdown_ignore_static: False
ifupdown_ignore_networkmanager

Should ifupdown role ignore presence of NetworkManager and generate the configuration in /etc/network/interfaces.d/?

ifupdown_ignore_networkmanager: False

Interface reconfiguration

ifupdown_reconfigure

Should ifupdown role automatically try to reconfigure interfaces that have been modified? Set to False to enable “dry-mode”.

ifupdown_reconfigure: True
ifupdown_reconfigure_auto

The ifupdown reconfiguration script will automatically stop and start affected interfaces on any configuration file changes. Setting this variable to False will prevent the script from messing with the live network interfaces, but it will still make changes in /etc/network/interfaces configuration, which will be used on the next reboot.

ifupdown_reconfigure_auto: True
ifupdown_reconfigure_auto_file

Name of the file which, if present, tells the reconfiguration script to not make changes in live network interfaces.

ifupdown_reconfigure_auto_file: '/run/network/ifupdown-manual'
ifupdown_reconfigure_script

Path where reconfiguration script is stored.

ifupdown_reconfigure_script: '{{ (ansible_local.root.lib
                                 if (ansible_local|d() and ansible_local.root|d()
                                     and ansible_local.root.lib|d())
                                 else "/usr/local/lib") +
                                 "/ifupdown-reconfigure-interfaces" }}'
ifupdown_reconfigure_init_file

Name of the file that contains an initial state of the ifupdown configuration and indicates that all network interfaces should be stopped before configuration.

ifupdown_reconfigure_init_file: '/etc/network/interfaces.d/old-interfaces'
ifupdown_apply_config

Apply generated interface configuration immediately. If set to False, the role will generate a script in the /tmp/ directory which will apply the configuration at the end of the current Ansible play.

ifupdown_apply_config: True
ifupdown_apply_config_pre_script

Shell commands in YAML text block format, which will be executed by the config script before interface reconfiguration.

ifupdown_apply_config_pre_script: ''
ifupdown_apply_config_post_script

Shell commands in YAML text block format, which will be executed by the config script after interface reconfiguration.

ifupdown_apply_config_post_script: ''

Network interface definition

ifupdown_default_config

Which default configuration from var/ directory should be used? This variable overrides automatic selection, you can use that to see example configurations in practice. Specify a filename without ‘.yml’ extension.

ifupdown_default_config: ""
ifupdown_external_interface

Default external network interface.

ifupdown_external_interface: 'eth0'
ifupdown_internal_interface

Default internal network interface.

ifupdown_internal_interface: 'eth1'
ifupdown_interface_weight_map

Configuration of network interfaces is read executed in alphabetical order. Because of that, order of different interface types is significant. This dictionary provides a mapping between various interface types and a “weight” value which will be prepended to the interface filename to create correct order of network interfaces.

You can override the default weight by specifying item.weight key in interface configuration.

ifupdown_interface_weight_map:
  'mapping':   '00'
  'interface': '10'
  'bond':      '20'
  'vlan':      '40'
  'bridge':    '60'
ifupdown_default_bridge_options

Default options added to each bridge if no custom options have been specified. By default, forward delay is 15s which is too long for DHCP. If you add your own options, these will be replaced.

ifupdown_default_bridge_options: |
  bridge_fd 0
ifupdown_interfaces

List of network interfaces. If it’s not defined, ifupdown role will automatically select a default set based on variables like presence of NetworkManager. Default sets are defined in ../vars/* files. See ifupdown_interfaces for more details.

ifupdown_interfaces: []

Interface augment maps

The dict variables listed below can be used to modify interface configuration without changing the entire ifupdown_interfaces layout. Each key should be an interface name, values are parameters which should be set for that interface. Examples:

ifupdown_map_interface_method:
  'br0': 'static'

ifupdown_map_interface_addresses:
  'br0': [ '192.0.2.30/24' ]

ifupdown_map_interface_gateway:
  'br0': '192.0.2.1'
ifupdown_map_interface_addresses

List of IP addresses to configure on a given interface.

ifupdown_map_interface_addresses: {}
ifupdown_map_interface_method

IPv4 method to use to configure given interface (dhcp, static, manual, etc.).

ifupdown_map_interface_method: {}
ifupdown_map_interface_method6

IPv6 method to use to configure given interface (dhcp, static, manual, etc.).

ifupdown_map_interface_method6: {}
ifupdown_map_interface_gateway

IPv4 gateway to set for a given interface.

ifupdown_map_interface_gateway: {}
ifupdown_map_interface_gateway6

IPv6 gateway to set for a given interface.

ifupdown_map_interface_gateway6: {}
ifupdown_map_interface_options

Options to add for a given IPv4 interface, in YAML text block format.

ifupdown_map_interface_options: {}
ifupdown_map_interface_options6

Options to add for a given IPv6 interface, in YAML text block format.

ifupdown_map_interface_options6: {}
ifupdown_map_interface_comment

Add custom comment to an interface instead of the default one.

ifupdown_map_interface_comment: {}
ifupdown_map_bridge_ports

List of ports to add to a specified bridge interface.

ifupdown_map_bridge_ports: {}
ifupdown_map_vlan_device

Specify an interface name to set as a VLAN device on a given VLAN interface.

ifupdown_map_vlan_device: {}