Files
configpolicy/roles/rhel-network/tasks/main.yml
Dustin C. Hatch 3169278429 roles/rhel-network: Enable/start service
The *networking* service, which is actually a legacy init script, is
provided by the *initscripts* package on RHEL and its derivatives. This
service needs to be running in order for the configuration generated by
the *rhel-network* role to be applied to the managed node.
2018-03-27 20:44:43 -05:00

31 lines
712 B
YAML

- name: ensure initscripts package is installed
package:
name=initscripts
state=present
tags:
- install
- 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(()) }}'
- name: ensure network starts at boot
service:
name=network
enabled=yes
- meta: flush_handlers
- name: ensure network is started
service:
name=network
state=started