summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/kubernetes-cluster-cleanup.yml2
-rw-r--r--roles/kubernetes/kubeadm/reset/handlers/main.yml (renamed from roles/kubernetes/net/kubeguard/reset/handlers/main.yml)0
-rw-r--r--roles/kubernetes/kubeadm/reset/tasks/main.yml3
-rw-r--r--roles/kubernetes/kubeadm/reset/tasks/net_kubeguard.yml (renamed from roles/kubernetes/net/kubeguard/reset/tasks/main.yml)6
4 files changed, 6 insertions, 5 deletions
diff --git a/common/kubernetes-cluster-cleanup.yml b/common/kubernetes-cluster-cleanup.yml
index d56940ee..7c10d17c 100644
--- a/common/kubernetes-cluster-cleanup.yml
+++ b/common/kubernetes-cluster-cleanup.yml
@@ -38,5 +38,3 @@
hosts: _kubernetes_nodes_remove_
roles:
- role: kubernetes/kubeadm/reset
- - role: kubernetes/net/kubeguard/reset
- when: hostvars[groups['_kubernetes_primary_master_'][0]].kubernetes_network_plugin == 'kubeguard'
diff --git a/roles/kubernetes/net/kubeguard/reset/handlers/main.yml b/roles/kubernetes/kubeadm/reset/handlers/main.yml
index bb7fde2b..bb7fde2b 100644
--- a/roles/kubernetes/net/kubeguard/reset/handlers/main.yml
+++ b/roles/kubernetes/kubeadm/reset/handlers/main.yml
diff --git a/roles/kubernetes/kubeadm/reset/tasks/main.yml b/roles/kubernetes/kubeadm/reset/tasks/main.yml
index 57a3faf4..cf9c125d 100644
--- a/roles/kubernetes/kubeadm/reset/tasks/main.yml
+++ b/roles/kubernetes/kubeadm/reset/tasks/main.yml
@@ -30,3 +30,6 @@
file:
path: "{{ item.path }}"
state: absent
+
+- name: extra-cleanup for kubeguard network plugin
+ import_tasks: net_kubeguard.yml
diff --git a/roles/kubernetes/net/kubeguard/reset/tasks/main.yml b/roles/kubernetes/kubeadm/reset/tasks/net_kubeguard.yml
index d24f9eff..03b3f205 100644
--- a/roles/kubernetes/net/kubeguard/reset/tasks/main.yml
+++ b/roles/kubernetes/kubeadm/reset/tasks/net_kubeguard.yml
@@ -5,17 +5,17 @@
register: kubeguard_interface_unit
- name: bring down kubeguard interface
+ when: kubeguard_interface_unit.stat.exists
systemd:
name: kubeguard-interfaces.service
state: stopped
- when: kubeguard_interface_unit.stat.exists
- name: gather list of all kubeguard related service units
find:
path: /etc/systemd/system/
patterns:
- - "kubeguard-peer-*.service"
- - kubeguard-interfaces.service
+ - "kubeguard-peer-*.service"
+ - kubeguard-interfaces.service
register: kubeguard_units_installed
- name: remove all kubeguard related files and directories