From 5b45f9bc46fedbef1ef0008735f5cd2d56cad8eb Mon Sep 17 00:00:00 2001 From: Shannon Mascarenhas <11484405+smasc@users.noreply.github.com> Date: Tue, 29 May 2018 12:52:02 -0500 Subject: [PATCH] Fix handling of autoconnect parameter This fixes a bug in the `network_connections` module when using the `initscripts` provider and encountering a connection with `autoconnect` set to false. It fails to write any `ONBOOT=` line to the interface's `ifcfg-*` file, which RHEL treats as equivalent to `ONBOOT=yes`. This explicitly sets `ONBOOT` for all interfaces defined, instead of relying on what RHEL considers its default value. --- library/network_connections.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/network_connections.py b/library/network_connections.py index 14e3d96..4dca651 100644 --- a/library/network_connections.py +++ b/library/network_connections.py @@ -1302,6 +1302,8 @@ class IfcfgUtil: if connection['autoconnect']: ifcfg['ONBOOT'] = 'yes' + else: + ifcfg['ONBOOT'] = 'no' ifcfg['DEVICE'] = connection['interface_name']