{"id":23503161,"url":"https://github.com/kpfleming/ansible-systemd-networkd","last_synced_at":"2025-05-05T08:53:36.691Z","repository":{"id":63688868,"uuid":"551449701","full_name":"kpfleming/ansible-systemd-networkd","owner":"kpfleming","description":"A collection of Ansible roles for managing the configuration of systemd-networkd.","archived":false,"fork":false,"pushed_at":"2025-02-15T12:13:34.000Z","size":23922,"stargazers_count":3,"open_issues_count":2,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-01T14:15:49.832Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://kpfleming.github.io/ansible-systemd-networkd/","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kpfleming.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"kpfleming","liberapay":"kpfleming"}},"created_at":"2022-10-14T12:25:17.000Z","updated_at":"2025-04-16T22:30:33.000Z","dependencies_parsed_at":"2023-10-16T04:15:51.077Z","dependency_job_id":"43c61f73-aa73-4be4-843c-13b84ac15181","html_url":"https://github.com/kpfleming/ansible-systemd-networkd","commit_stats":null,"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kpfleming%2Fansible-systemd-networkd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kpfleming%2Fansible-systemd-networkd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kpfleming%2Fansible-systemd-networkd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kpfleming%2Fansible-systemd-networkd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kpfleming","download_url":"https://codeload.github.com/kpfleming/ansible-systemd-networkd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251887192,"owners_count":21659936,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-25T08:15:45.876Z","updated_at":"2025-05-01T14:15:59.517Z","avatar_url":"https://github.com/kpfleming.png","language":"Jinja","funding_links":["https://github.com/sponsors/kpfleming","https://liberapay.com/kpfleming"],"categories":[],"sub_categories":[],"readme":"# ansible-systemd-networkd\n\n\u003ca href=\"https://opensource.org\"\u003e\u003cimg height=\"150\" align=\"left\" src=\"https://opensource.org/files/OSIApprovedCropped.png\" alt=\"Open Source Initiative Approved License logo\"\u003e\u003c/a\u003e\n[![CI](https://github.com/kpfleming/ansible-systemd-networkd/workflows/CI/badge.svg)](https://github.com/kpfleming/ansible-systemd-networkd/actions?query=workflow%3ACI)\n[![License - Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-9400d3.svg)](https://spdx.org/licenses/Apache-2.0.html)\n\nThis repo contains the `kpfleming.systemd_networkd` Ansible Collection. The collection includes roles to manage\nthe configuration of various features of systemd-networkd.\n\nOpen Source software: [Apache License 2.0][3]\n\n## \u0026nbsp;\n\n## Included content\n\n* Roles:\n  - kpfleming.systemd_networkd.bond: manage bond virtual devices\n  - kpfleming.systemd_networkd.dummy: manage dummy virtual devices\n  - kpfleming.systemd_networkd.link: manage links\n  - kpfleming.systemd_networkd.network: manage network devices\n  - kpfleming.systemd_networkd.tunnel: manage generic tunnel virtual devices\n  - kpfleming.systemd_networkd.vlan: manage vlan virtual devices\n  - kpfleming.systemd_networkd.wireguard: manage WireGuard virtual devices\n\n## Features of this collection\n\n* Ansible-style arguments with extensive validation\n\n  systemd's argument naming format is not compatible with Ansible best practices, so these roles\n  use Ansible-style names and translate them when producing configuration files for systemd-networkd.\n  For example, 'MACAddress' (systemd) becomes 'mac_address' (Ansible), 'IPv6ProxyNDPAddress' (systemd)\n  becomes 'ipv6_proxy_ndp_address' (Ansible), etc.\n\n  In addition Ansible's role `argument_specs` feature is used to fully document and validate all\n  arguments passed to the roles, ensuring that configuration errors are discovered before the roles\n  generate configuration files. The documentation linked in the 'Included content' section above is generated\n  from the `argument_specs`.\n\n* Composition (one role per networkd object, usually)\n\n  Rather than providing a higher-level abstraction of a 'network' with all of its possible configuration\n  options, these roles provide direct access to the systemd-networkd objects so that the user can configure\n  and compose them in any way that they wish. See the 'Examples' section below for a complex real-world\n  configuration.\n\n* Use of drop-in directories\n\n  In order to avoid multiple roles attempting to manage content in the same files, all of the roles make\n  use of the systemd-networkd 'drop-in directory' feature where it is applicable.\n\n## Using this collection\n\nIn order to use this collection, you need to install it using the\n`ansible-galaxy` CLI:\n\n    ansible-galaxy collection install kpfleming.systemd_networkd\n\nYou can also include it in a `requirements.yml` file and install it\nvia `ansible-galaxy collection install -r requirements.yml` using the\nformat:\n\n```yaml\ncollections:\n  - name: kpfleming.systemd_networkd\n```\n\nSee [Ansible Using collections][5] for more details.\n\n## Examples\n\nThis playbook example combines six of the roles in this collection. It features:\n\n* Renaming of two NICs (matched using their PCI paths) and bonding them using\n  802.3ad (LACP).\n* Two VLANs on top of of the bonded interface.\n* A SIT (IPv6-in-IPv4) tunnel on top of one of the VLANs.\n* Three dummy interfaces used for application addresses.\n* Various attributes and features of the 'network' role.\n\n```yaml\n- name: manage bond devices\n  ansible.builtin.include_role:\n    name: kpfleming.systemd_networkd.bond\n    vars:\n      bonds:\n        - name: transport\n          mode: 802.3ad\n          transmit_hash_policy: layer2+3\n          mii_monitor_sec: 1s\n          up_delay_sec: 5s\n          min_links: 1\n          members:\n            - device:\n                path: pci-0000:01:00.0\n            - device:\n                path: pci-0000:02:00.0\n\n- name: manage VLAN devices\n  ansible.builtin.include_role:\n    name: kpfleming.systemd_networkd.vlan\n    vars:\n      vlans:\n        - name: fios\n          underlying_name: transport\n          id: 3000\n        - name: corosync\n          underlying_name: transport\n          id: 101\n\n- name: manage tunnel devices\n  ansible.builtin.include_role:\n    name: kpfleming.systemd_networkd.tunnel\n    vars:\n      tunnels:\n        - name: hetunnel\n          underlying_name: fios\n          kind: sit\n          local: dhcp4\n          remote: 209.51.161.14\n          ttl: 255\n          netdev:\n            mtu_bytes: 1480\n\n- name: manage dummy devices\n  ansible.builtin.include_role:\n    name: kpfleming.systemd_networkd.dummy\n    vars:\n      dummies:\n        - name: mgmt\n        - name: ntp\n        - name: dns\n\n- name: manage networks\n  ansible.builtin.include_role:\n    name: kpfleming.systemd_networkd.network\n    vars:\n      networks:\n        - name: transport\n          match:\n            device:\n              name: transport\n          ip_forward: true\n          ntp:\n            - 2001:470:8afe:255::1\n          addresses:\n            - address: 192.168.121.3/24\n        - name: mgmt\n          match:\n            device:\n              name: mgmt\n          addresses:\n            - address: 192.168.120.3/32\n            - address: 2001:470:8afe:120::3/128\n              home_address: true\n        - name: dns\n          match:\n            device:\n              name: dns\n          link:\n            activation_policy: manual\n          addresses:\n            - address: 192.168.255.2/32\n            - address: 2001:470:8afe:255::2/128\n        - name: ntp\n          match:\n            device:\n              name: ntp\n          link:\n            activation_policy: manual\n          addresses:\n            - address: 192.168.255.1/32\n            - address: 2001:470:8afe:255::1/128\n        - name: corosync\n          match:\n            device:\n              name: corosync\n          link:\n            activation_policy: always-up\n          dhcp: false\n          configure_without_carrier: true\n          link_local_addressing: false\n          addresses:\n            - address: 192.168.101.3/24\n        - name: fios\n          match:\n            device:\n              name: fios\n          link:\n            activation_policy: manual\n            mac_address: 56:a2:d0:4b:bb:1f\n          dhcp: ipv4\n          ip_forward: true\n          link_local_addressing: false\n          dhcpv4:\n            use_hostname: false\n            send_release: false\n        - name: hetunnel\n          match:\n            device:\n              name: hetunnel\n          ip_forward: true\n          bind_carrier:\n            - fios\n          addresses:\n            - address: 2001:470:1f06:fab::2/64\n          routes:\n            - gateway: 2001:470:1f06:fab::1\n```\n\nDocumentation of the collections's modules and their arguments/return\nvalues can be found [here][1].\n\n## Contributing to this collection\n\nIf you want to develop new content for this collection or improve what\nis already here, the easiest way to work on the collection is to clone\nit into one of the configured [`COLLECTIONS_PATH`][6], and work on it\nthere.\n\nYou can find more information in the [developer guide for\ncollections][7], and in the [Ansible Community Guide][8].\n\n\n## More information\n\n- [Ansible Collection overview](https://github.com/ansible-collections/overview)\n- [Ansible User guide](https://docs.ansible.com/ansible/latest/user_guide/index.html)\n- [Ansible Developer guide](https://docs.ansible.com/ansible/latest/dev_guide/index.html)\n- [Ansible Collections Checklist](https://github.com/ansible-collections/overview/blob/master/collection_requirements.rst)\n\n[1]: https://kpfleming.github.io/ansible-systemd-networkd\n[3]: https://spdx.org/licenses/Apache-2.0.html\n[5]: https://docs.ansible.com/ansible/latest/user_guide/collections_using.html\n[6]: https://docs.ansible.com/ansible/latest/reference_appendices/config.html#collections-paths\n[7]: https://docs.ansible.com/ansible/devel/dev_guide/developing_collections.html#contributing-to-collections\n[8]: https://docs.ansible.com/ansible/latest/community/index.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkpfleming%2Fansible-systemd-networkd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkpfleming%2Fansible-systemd-networkd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkpfleming%2Fansible-systemd-networkd/lists"}