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:
13
roles/rhel-network/tasks/main.yml
Normal file
13
roles/rhel-network/tasks/main.yml
Normal 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(()) }}'
|
||||
Reference in New Issue
Block a user