network: Playbook to configure networking

The `network.yml` playbook is used to configure the network interfaces
on a managed node. Currently, it only supports the Red Hat configuration
style (i.e. `/etc/sysconfig/network-scripts/ifcfg-*` files).
This commit is contained in:
2018-03-13 23:20:11 -05:00
parent 7de51f4bc5
commit 2a5b257943
5 changed files with 82 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
- name: ensure network devices are configured
template:
src=ifcfg.j2
dest=/etc/sysconfig/network-scripts/ifcfg-{{ item.ifname }}
mode=0644
with_items: '{{ network.interfaces }}'
notify: restart network
- name: ensure ignored devices are not configured
file:
path=/etc/sysconfig/network-scripts/ifcfg-{{ item }}
state=absent
with_items: '{{ network.ignore_interfaces|d(()) }}'