Redesign interfaces.
New API
interfaces
Action Configures network interfaces.
Variables
-
networking_interfaces
- list of interfaces configuration to set.-
name
- interface name (forethernet
type name assigned by operating system must be used) -
(optional)
type
- interface type (one ofethernet
,bond
,vlan
), if not specifiedethernet
will be used. -
(optional)
enable_dhcp
- shoudl DHCP be used on interface (default:false
) -
(optional)
addresses
- list of ip adresses in CIDR format (default:'[]'
) -
(optional)
gateway
- default route associated with interface.⚠ setting gateway on multiple interfaces will cause single(random) default route to be used, instead of expected ECMP. -
(optional)
mtu
- sets interface Maximum Transmission Unit. (default:1500
) (if increasing remember to adjust underlays accoringly if used) -
(optional)
underlay
- list of names or name of underlay interfaces (required onbond
andvlan
) for vlan use string with name, for bonding list. -
(optional)
vlan_id
- 802.1Q vlan identifier (required onvlan
) -
(optional)
bonding
- dictionary with bonding options:-
(optional)
mode
- mode of bonding to use (one of:balance-rr
,active-backup
,balance-xor
,broadcast
,802.3ad
,balance-tlb
,balance-alb
) default ("balance-rr"
) -
(optional)
carrer_check_interval
- interval between checking if bond underlay interface has carrer connected. by default cerrer checking is disabled. -
(optional)
lacp_rate
- Set the rate at which LACPDUs are transmitted. This is only useful in 802.3ad mode. Possible values areslow
(30 seconds, default) orfast
(every second).
-
(optional)
-
-
(optional)
networking_interfaces_apply_immediately
- sets if network configuration should be applied immediately after configuration change (actioninterfaces_apply
will be called). (default:yes
)⚠ WARNING⚠ - whennetworking_interfaces_apply_immediately: no
, you need to runinterfaces_apply
after preparing host for network downtime.
Facts
-
networking_facts.apply_required
- setyes
if network configuration should be applied, this fact will be cached on managed server
interfaces_apply
Action -
networking_facts.apply_required
- fact obtained during run ofinterfaces
action. -
(optional)
networking_interfaces_synchronize_immediately
- sets if action should wait for networking restart to finish (by callinginterfaces_synchronize
action). (default:yes
)⚠ WARNING⚠ - whennetworking_interfaces_synchronize_immediately: no
, you need to runinterfaces_synchronize
after changeansible_ssh_host
ansible_ssh_extra_args
if needed.
Facts
-
networking_facts.apply_required
- Always set toFalse
fact will be saved on server during run ofinterfaces_synchronize
action
interfaces_synchronize
Action Wait for hosts to become available and save networking_facts.apply_required
Variables
-
networking_facts.apply_required
- fact obtained during run ofinterfaces_apply
action.
Added 22.11.2021
What was changed with primary plan:
- action
interfaces_apply
was merged withinterfaces_synchronize
to avoid issues with finalization of network apply task, which is run in async mode now. - action
interfaces_apply
- now setansible_host
when requested -
infiniband
interface type was added -
routes
definition was added to interfaces definition, intergatingroutes
action withinterfaces
- Adjusted defaults with real behaviour.
New API after changes required by implementation issues
interfaces
Action Configures network interfaces.
Variables
-
networking_interfaces
- list of interfaces configuration to set.-
name
- interface name (forethernet
type name assigned by operating system must be used) -
(optional)
type
- interface type (one ofethernet
,bond
,vlan
,infiniband
), if not specifiedethernet
will be used. -
(optional)
infiniband_transport_mode
- transport mode for InfiniBand connection, available options are"datagram"
and"connected"
. This parameter is required for allinfiniband
interfaces. -
(optional)
enable_dhcp
- should DHCP be used on interface (default:false
) -
(optional)
addresses
- list of IP addresses in CIDR format (default:'[]'
) -
(optional)
mtu
- sets interface Maximum Transmission Unit. (default:0
, using device default) (when increasing, remember to adjust underlays accordingly if used) -
(optional)
routing
- dictionary with on link routing parameters-
(optional)
table
- id of routing table associated with link (default:main
) -
(optional)
routes
- list dictionaries describing link associated routing entries (all routes will be added to table set for device)-
network
- target network in CIDR format. -
via
- gateway address.
-
-
(optional)
-
(optional)
gateway
- default route associated with interface.⚠ setting gateway on multiple interfaces will cause single (random) default route to be used, instead of expected ECMP. -
(optional)
underlay
- list of names or name of underlay interfaces (required onbond
andvlan
) for VLAN use string with name, for bonding list. -
(optional)
vlan_id
-802.1Q
VLAN identifier (required onvlan
) -
(optional)
bonding
- dictionary with bonding options:-
(optional)
mode
- mode of bonding to use (one of:balance-rr
,active-backup
,balance-xor
,broadcast
,802.3ad
,balance-tlb
,balance-alb
) default ("balance-rr"
) -
(optional)
carrer_check_interval
- interval between checking if bond underlay interface are connected. (default100
) -
(optional)
lacp_rate
- Set the rate at which LACPDU's are transmitted. This is only useful in802.3ad
mode. Possible values areslow
(30 seconds) orfast
(every second). (default:slow
)
-
(optional)
-
-
(optional)
networking_interfaces_synchronize_immediately
- sets if network configuration should be applied immediately after configuration change (actioninterfaces_synchronize
will be called). (default:yes
)⚠ WARNING⚠ - whennetworking_interfaces_synchronize_immediately: no
, you need to runinterfaces_synchronize
after preparing host for network downtime.
Facts
-
networking_facts.interfaces_apply_required
- set toyes
if network configuration should be applied, this fact will be cached on managed server
interfaces_synchronize
Action Wait for hosts to become available, save networking_facts.interfaces_apply_required
and refresh Ansible network facts.
Variables
-
networking_facts.interfaces_apply_required
- fact obtained during run ofinterfaces
action. -
(optional)
networking_swap_ansible_host
- new access address/domain for host that should be used after restarting of network, by default access address will not be changed.
Facts
-
networking_facts.interfaces_apply_required
- action clears requirement for apply, by always setting this fact tono
, and caching it on server. -
ansible_host
- This fact will be set to{{ networking_swap_ansible_host }}
if specified.
Additionally ansible_facts
for network will be refreshed.
Edited by Piotr Korthals