From 53a1134b6f9df9e0354cbb29d154188891b0bbdc Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Fri, 21 Apr 2017 14:12:15 +0200 Subject: [PATCH] detect presence of hotplug network interface --- evolinux-base/tasks/system.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/evolinux-base/tasks/system.yml b/evolinux-base/tasks/system.yml index 80f81a69..d6733944 100644 --- a/evolinux-base/tasks/system.yml +++ b/evolinux-base/tasks/system.yml @@ -140,12 +140,19 @@ ## network interfaces +- name: "Is there an \"allow-hotplug\" interface ?" + command: grep allow-hotplug /etc/network/interfaces + failed_when: False + changed_when: False + check_mode: no + register: grep_hotplug_eni + - name: "Network interfaces must be \"auto\" and not \"allow-hotplug\"" replace: dest: /etc/network/interfaces regexp: "allow-hotplug" replace: "auto" backup: yes - when: evolinux_system_eni_auto + when: evolinux_system_eni_auto and grep_hotplug_eni.rc == 0 - meta: flush_handlers