• Blog
  • Ansible community forum
  • Documentation
Ansible Logo
Collections Documentation
Collections
  • kpfleming.systemd_networkd.bond role – Manages systemd-networkd bonded network devices.
  • kpfleming.systemd_networkd.dummy role – Manages systemd-networkd dummy virtual network devices.
  • kpfleming.systemd_networkd.global role – Manages systemd-networkd global configuration.
  • kpfleming.systemd_networkd.link role – Manages systemd-networkd links.
    • Entry point main – Manages systemd-networkd links.
      • Synopsis
      • Parameters
        • Collection links
  • kpfleming.systemd_networkd.network role – Manages systemd-networkd networks.
  • kpfleming.systemd_networkd.tunnel role – Manages systemd-networkd tunnel virtual network devices.
  • kpfleming.systemd_networkd.vlan role – Manages systemd-networkd VLAN virtual network devices.
  • kpfleming.systemd_networkd.wireguard role – Manages systemd-networkd WireGuard tunnel virtual network devices.
Collections
  • kpfleming.systemd_networkd.link role – Manages systemd-networkd links.

kpfleming.systemd_networkd.link role – Manages systemd-networkd links.

Note

This role is part of the kpfleming.systemd_networkd collection (version 25.3.0).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it use: ansible-galaxy collection install kpfleming.systemd_networkd.

To use it in a playbook, specify: kpfleming.systemd_networkd.link.

  • Entry point main – Manages systemd-networkd links.

    • Synopsis

    • Parameters

Entry point main – Manages systemd-networkd links.

Synopsis

  • This role will create (or update) one item in /etc/systemd/network for each specified link: a .link file for the link.

  • On Debian and Debian-derivative systems the .link files are copied into the initramfs by the `update-initramfs` tool, which means that the system must be rebooted for changes in those files to take effect. In this situation the role will set a fact named ‘systemd_networkd_link_reboot_required’ and the system should be rebooted before any additional configuration of the links is attempted.

  • Detailed descriptions of parameters and their behavior can be found in ‘man systemd.link’.

  • Sets fact named ‘systemd_networkd_link_changed’ to either true or false to indicate whether any changes were made.

Parameters

Parameter

Comments

links

list / elements=dictionary / required

Attributes of the links to be managed.

mac_address_policy

string

Policy for setting the MAC address of the link.

Choices:

  • "persistent"

  • "random"

  • "none"

match

dictionary

Matching attributes of the link.

device

dictionary

Device-specific attributes to be matched.

driver

list / elements=string

Match udev ID_NET_DRIVER.

kind

list / elements=string

Match netlink IFLA_INFO_KIND.

mac_address

list / elements=string

Match current MAC address.

original_name

list / elements=string

Match udev INTERFACE.

path

list / elements=string

Match udev ID_PATH.

permanent_mac_address

list / elements=string

Match permanent MAC address.

property

list / elements=string

Match udev property.

type

list / elements=string

Match udev DEVTYPE.

system

dictionary

System-specific attributes to be matched.

architecture

string

Match system architecture.

credential

string

Match service credential.

firmware

string

Match system firmware.

host

string

Match hostname or machine ID.

kernel_command_line

string

Match kernel command line option presence.

kernel_version

string

Match kernel version expression.

virtualization

string

Match virtualization type.

mtu_bytes

string

The MTU for the link.

name

string

Name to set on the link.

name_policy

string

Policy for setting the name of the link.

Choices:

  • "kernel"

  • "database"

  • "onboard"

  • "slot"

  • "path"

  • "mac"

  • "keep"

suppress_reload

boolean

Suppress the reloading of systemd-networkd if changes are made.

Choices:

  • false ← (default)

  • true

systemd_root

string

Root path of filesystem containing systemd-networkd configuration files.

Default: ""

Collection links

  • Issue Tracker
  • Repository (Sources)
Previous Next

© Copyright Kevin P. Fleming and project contributors.