add function to reset innernet completely

This commit is contained in:
linus 2021-12-20 17:56:30 +01:00
parent e9045532f4
commit b846da2985
2 changed files with 30 additions and 2 deletions

View File

@ -3,6 +3,19 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # 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 - name: Install needed packages
tags: [update] tags: [update]
apt: apt:
@ -51,3 +64,4 @@
systemd: systemd:
name: "innernet@{{ network_name }}" name: "innernet@{{ network_name }}"
state: started state: started
enabled: true

View File

@ -3,6 +3,19 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # 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 - name: Install needed packages
tags: [update] tags: [update]
apt: apt:
@ -12,13 +25,13 @@
- wireguard-tools - wireguard-tools
- name: Copy package to server - name: Copy package to server
tags: [never, update] tags: [update]
synchronize: synchronize:
src: "innernet-server.deb" src: "innernet-server.deb"
dest: "/tmp/innernet-server.deb" dest: "/tmp/innernet-server.deb"
- name: Install package - name: Install package
tags: [never, update] tags: [update]
apt: apt:
deb: "/tmp/innernet-server.deb" deb: "/tmp/innernet-server.deb"
update_cache: true update_cache: true
@ -93,3 +106,4 @@
systemd: systemd:
name: "innernet-server@{{ network_name }}" name: "innernet-server@{{ network_name }}"
state: started state: started
enabled: true