michaelrigart / ansible-role-interfaces

An ansible role for configuring different network interfaces
GNU General Public License v3.0
83 stars 62 forks source link

Network not configured after reboot on RHEL/CentOS 8 #68

Closed priteau closed 4 years ago

priteau commented 4 years ago

On RHEL/CentOS 8, this role now installs the network-scripts RPM. This RPM provides the legacy ifup / ifdown implementations that can bypass NetworkManager. It also provides a network init.d script. However, this script is not enabled by default.

Since we use NM_CONTROLLED=no, this means that a role invocation will work fine, until the next reboot or until the DHCP lease expires (when using DHCP), whichever comes first.

Steps to reproduce in a fresh CentOS 8 cloud image using DHCP on eth0:

- hosts: localhost
  roles:
    - role: MichaelRigart.interfaces
      interfaces_ether_interfaces:
       - device: eth0
         bootproto: dhcp

Expected result

Network is functional

Actual result

No network is configured

Solution

Enable the legacy network init script:

$ sudo systemctl enable network.service
network.service is not a native service, redirecting to systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable network