From 8a43107122062bca3b9ceeadbc177d7fc8d22ee9 Mon Sep 17 00:00:00 2001 From: Saravanan KR Date: Fri, 27 Jul 2018 15:44:16 +0530 Subject: [PATCH] Avoid ifcfg files modification when a reboot is not required A reboot is required after updating the kernel args. In order for a successful reboot, ifcfg files of unused interfaces are update so that it reboot will not fail in network service start. These ifcfg file modifications are not required during the second run when the reboot is not required (after kernel args set and reboot). Added a check to avoid the file modification when it is not required. Change-Id: Ib2381c434d2e14c99f30beb7963acbbe58c4cb64 --- extraconfig/pre_network/boot_param_tasks.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/extraconfig/pre_network/boot_param_tasks.yaml b/extraconfig/pre_network/boot_param_tasks.yaml index 0d202d1858..25a7442ec3 100644 --- a/extraconfig/pre_network/boot_param_tasks.yaml +++ b/extraconfig/pre_network/boot_param_tasks.yaml @@ -55,6 +55,7 @@ patterns: ifcfg-* contains: "# This file is autogenerated by os-net-config" register: os_net_ifcfg_files + when: reboot_required is defined and reboot_required # Provisioning Network workaround # The script will be executed before os-net-config, in which case, only Provisioning network will have IP @@ -79,4 +80,6 @@ with_items: - "{{ ifcfg_files.files }}" become: true - when: os_net_ifcfg_files.matched == 0 + when: + - reboot_required is defined and reboot_required + - os_net_ifcfg_files.matched == 0