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
---
- 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

View File

@ -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