roles/net-ifaces: Configure virtual net interfaces

The *net-ifaces* role manages a script that creates virtual network
interfaces, such as bridge, bond, and VLAN, that `dhcpcd`/`dhclient`
alone cannot. This provides a lightweight alternative to
*systemd-networkd* and *NetworkMangager*.
jenkins-master
Dustin 2018-07-23 17:32:12 -05:00
parent 44a82688e4
commit 704850caa9
3 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,11 @@
[Unit]
Description=Create virtual network interfaces
Before=network.target network-online.target dhcpcd.service
[Service]
Type=oneshot
ExecStart=/usr/local/libexec/net-ifaces.sh
RemainAfterExit=true
[Install]
WantedBy=network.target

View File

@ -0,0 +1,2 @@
- name: reload systemd
command: systemctl daemon-reload

View File

@ -0,0 +1,17 @@
- name: ensure net-ifaces script is installed
copy:
src={{ inventory_hostname }}.sh
dest=/usr/local/libexec/net-ifaces.sh
mode=0755
- name: ensure net-ifaces systemd unit is installed
copy:
src=net-ifaces.service
dest=/etc/systemd/system/net-ifaces.service
mode=0644
notify: reload systemd
- name: ensure net-ifaces service starts at boot
service:
name=net-ifaces
enabled=yes