Ansible role for systemd-networkd
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Oleg "Zmey!" Vasiliev 279bff42a8 Fix typo 2 years ago
defaults Hotfixes after galaxy upload 2 years ago
handlers Hotfixes after galaxy upload 2 years ago
meta Fix typo 2 years ago
tasks Hotfixes after galaxy upload 2 years ago
templates Inital release 0.1.0 2 years ago
CHANGELOG.md Fix typo 2 years ago
LICENSE Inital release 0.1.0 2 years ago
README.md Inital release 0.1.0 2 years ago

README.md

networkd

An Ansible role for configuring systemd-networkd.

This project adheres to Semantic Versioning.

Requirements

This role assumes that networkd is already present in the system. So it should be suitable for any distro with networkd.

Role Variables

Example configuration. Follow networkd documentation to construct yours.

networkd:
 link:
     # This is file name
   - name: eth0
     # This is prefix for file. This results in following file name: 50-eth0.link
     priority: 50
     content:
       - Match:
         - MACAddress: "aa:bb:cc:dd:ee:ff"
       - Link:
         - Name: eth0
 netdev:
   - name: br0
     priority: 50
     content:
       - NetDev:
         - Name: br0
         - Kind: bridge
 network:
   - name: eth0
     priority: 50
     content:
       - Match:
         - Name: eth0
       - Network:
         - DHCP: ipv4
         - LinkLocalAddressing: no
         - LLDP: yes
       - DHCPv4:
         - UseHostname: no
         - Hostname: gimme-some-addr
         - UseMTU: yes
   - name: br0_slaves
     priority: 50
     content:
       - Match:
         - MACAddress: "11:bb:cc:dd:ee:ff 22:bb:cc:dd:ee:ff"
       - Network:
         - Bridge: br0

What to do on configuration changes. Could be "restart", "reload" or "nothing". Variable is mandatory.

networkd_apply_action: "restart"

Custom content for /etc/resolv.conf. Every element in list is string in file. Variable is optional.

networkd_resolv_conf_content:
  - nameserver 1.1.1.1
  - nameserver 8.8.8.8

License

MIT