From 8c74bd1f5c0f0ca43380448ab4cf17b946efda4b Mon Sep 17 00:00:00 2001
From: Robin Sonnabend <robin@fsmpi.rwth-aachen.de>
Date: Thu, 1 Aug 2019 21:30:19 +0200
Subject: [PATCH] Delete network config files from instance-debootstrap

---
 networkd/tasks/main.yml | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/networkd/tasks/main.yml b/networkd/tasks/main.yml
index 173578c..afaab46 100644
--- a/networkd/tasks/main.yml
+++ b/networkd/tasks/main.yml
@@ -21,6 +21,20 @@
   notify:
     - restart networkd
 
+- name: find network config files generated by the bootstrap process
+  find:
+    path: /etc/systemd/network
+    pattern: bootstrap-*.network
+  register: bootstrap_network_files
+
+- name: delete network config files generated by the bootstrap process
+  file:
+    path: "{{item.path}}"
+    state: absent
+  loop: "{{bootstrap_network_files.files}}"
+  notify:
+    - restart networkd
+
 - name: ensure bonding works correctly
   include_tasks: bond.yml
   loop: "{{ networkd|default([{'type': networkd_type}])|flatten(levels=1) }}"
-- 
GitLab