diff options
Diffstat (limited to 'roles/kubernetes/kubeadm/reset/tasks/net_kubeguard.yml')
-rw-r--r-- | roles/kubernetes/kubeadm/reset/tasks/net_kubeguard.yml | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/roles/kubernetes/kubeadm/reset/tasks/net_kubeguard.yml b/roles/kubernetes/kubeadm/reset/tasks/net_kubeguard.yml new file mode 100644 index 00000000..03b3f205 --- /dev/null +++ b/roles/kubernetes/kubeadm/reset/tasks/net_kubeguard.yml @@ -0,0 +1,26 @@ +--- +- name: check if kubeguard interface service unit exists + stat: + path: /etc/systemd/system/kubeguard-interfaces.service + register: kubeguard_interface_unit + +- name: bring down kubeguard interface + when: kubeguard_interface_unit.stat.exists + systemd: + name: kubeguard-interfaces.service + state: stopped + +- name: gather list of all kubeguard related service units + find: + path: /etc/systemd/system/ + patterns: + - "kubeguard-peer-*.service" + - kubeguard-interfaces.service + register: kubeguard_units_installed + +- name: remove all kubeguard related files and directories + loop: "{{ kubeguard_units_installed.files | map(attribute='path') | list | flatten | union(['/var/lib/kubeguard']) }}" + file: + path: "{{ item }}" + state: absent + notify: reload systemd |