From b846da298588eed1eb67489148fe4547b46a1dea Mon Sep 17 00:00:00 2001 From: linus Date: Mon, 20 Dec 2021 17:56:30 +0100 Subject: [PATCH] add function to reset innernet completely --- roles/client/tasks/main.yml | 14 ++++++++++++++ roles/server/tasks/main.yml | 18 ++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/roles/client/tasks/main.yml b/roles/client/tasks/main.yml index d8ce651..98468a4 100644 --- a/roles/client/tasks/main.yml +++ b/roles/client/tasks/main.yml @@ -3,6 +3,19 @@ # SPDX-License-Identifier: AGPL-3.0-or-later --- +- name: Install needed packages + tags: [never, uninstall] + apt: + package: + - python3-pexpect + +- name: Remove existing innernet + tags: [never, uninstall] + expect: + command: "innernet uninstall {{ network_name }}" + responses: + (?i)delete: "yes" + - name: Install needed packages tags: [update] apt: @@ -51,3 +64,4 @@ systemd: name: "innernet@{{ network_name }}" state: started + enabled: true diff --git a/roles/server/tasks/main.yml b/roles/server/tasks/main.yml index 429c8f8..e17468c 100644 --- a/roles/server/tasks/main.yml +++ b/roles/server/tasks/main.yml @@ -3,6 +3,19 @@ # SPDX-License-Identifier: AGPL-3.0-or-later --- +- name: Install needed packages + tags: [never, uninstall] + apt: + package: + - python3-pexpect + +- name: Remove existing innernet + tags: [never, uninstall] + expect: + command: "innernet-server uninstall {{ network_name }}" + responses: + (?i)delete: "yes" + - name: Install needed packages tags: [update] apt: @@ -12,13 +25,13 @@ - wireguard-tools - name: Copy package to server - tags: [never, update] + tags: [update] synchronize: src: "innernet-server.deb" dest: "/tmp/innernet-server.deb" - name: Install package - tags: [never, update] + tags: [update] apt: deb: "/tmp/innernet-server.deb" update_cache: true @@ -93,3 +106,4 @@ systemd: name: "innernet-server@{{ network_name }}" state: started + enabled: true