From 316927842900dd1ca1e596506cfcec713e5b1476 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Fri, 23 Mar 2018 10:09:47 -0500 Subject: [PATCH] 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. --- roles/rhel-network/tasks/main.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/roles/rhel-network/tasks/main.yml b/roles/rhel-network/tasks/main.yml index 5cd599e..48b215b 100644 --- a/roles/rhel-network/tasks/main.yml +++ b/roles/rhel-network/tasks/main.yml @@ -1,3 +1,10 @@ +- name: ensure initscripts package is installed + package: + name=initscripts + state=present + tags: + - install + - name: ensure network devices are configured template: src=ifcfg.j2 @@ -11,3 +18,13 @@ 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