mirror of
https://git.fsfe.org/fsfe-system-hackers/innernet-playbook.git
synced 2024-11-25 08:03:11 +01:00
improve uninstallation mechanism and prevent accidental removal
This commit is contained in:
parent
e0b5bf5ebb
commit
75c2682bef
14
deploy.yml
14
deploy.yml
@ -6,6 +6,20 @@
|
|||||||
- hosts: all
|
- hosts: all
|
||||||
remote_user: root
|
remote_user: root
|
||||||
tasks:
|
tasks:
|
||||||
|
- pause:
|
||||||
|
prompt: "You are using a function to UNINSTALL innernet on the chosen hosts {{ play_hosts }}. Continue? (yes/no)?"
|
||||||
|
tags: [never, uninstall]
|
||||||
|
register: uninstall_confirm
|
||||||
|
delegate_to: localhost
|
||||||
|
run_once: yes
|
||||||
|
|
||||||
|
- fail:
|
||||||
|
msg: Aborted uninstallation of innernet.
|
||||||
|
tags: [never, uninstall]
|
||||||
|
when: not uninstall_confirm.user_input | bool
|
||||||
|
delegate_to: localhost
|
||||||
|
run_once: yes
|
||||||
|
|
||||||
- name: Get innernet-server hostname from inventory groups
|
- name: Get innernet-server hostname from inventory groups
|
||||||
set_fact:
|
set_fact:
|
||||||
# Assuming that we only have one innernet server, we take the first
|
# Assuming that we only have one innernet server, we take the first
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
- ['-fsfe-be', '']
|
- ['-fsfe-be', '']
|
||||||
|
|
||||||
- name: Gather which packages are installed on the client
|
- name: Gather which packages are installed on the client
|
||||||
tags: [update]
|
tags: [update, uninstall]
|
||||||
package_facts:
|
package_facts:
|
||||||
manager: auto
|
manager: auto
|
||||||
|
|
||||||
@ -31,12 +31,21 @@
|
|||||||
- wireguard-tools
|
- wireguard-tools
|
||||||
- ufw
|
- ufw
|
||||||
|
|
||||||
- name: Remove existing innernet
|
- name: Remove existing innernet configuration on client
|
||||||
tags: [never, uninstall]
|
tags: [never, uninstall]
|
||||||
expect:
|
expect:
|
||||||
command: "innernet uninstall {{ network_name }}"
|
command: "innernet uninstall {{ network_name }}"
|
||||||
responses:
|
responses:
|
||||||
(?i)delete: "yes"
|
(?i)delete: "yes"
|
||||||
|
when: "'innernet' in ansible_facts.packages"
|
||||||
|
|
||||||
|
- name: Remove innernet package on client
|
||||||
|
tags: [never, uninstall]
|
||||||
|
apt:
|
||||||
|
name: innernet
|
||||||
|
state: absent
|
||||||
|
purge: yes
|
||||||
|
when: "'innernet' in ansible_facts.packages"
|
||||||
|
|
||||||
- name: Install innernet package on client
|
- name: Install innernet package on client
|
||||||
tags: [update]
|
tags: [update]
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
---
|
---
|
||||||
- name: Gather which packages are installed on the server
|
- name: Gather which packages are installed on the server
|
||||||
tags: [update]
|
tags: [update, uninstall]
|
||||||
package_facts:
|
package_facts:
|
||||||
manager: auto
|
manager: auto
|
||||||
|
|
||||||
@ -18,12 +18,21 @@
|
|||||||
- wireguard-tools
|
- wireguard-tools
|
||||||
- ufw
|
- ufw
|
||||||
|
|
||||||
- name: Remove existing innernet
|
- name: Remove existing innernet configuration
|
||||||
tags: [never, uninstall]
|
tags: [never, uninstall]
|
||||||
expect:
|
expect:
|
||||||
command: "innernet-server uninstall {{ network_name }}"
|
command: "innernet-server uninstall {{ network_name }}"
|
||||||
responses:
|
responses:
|
||||||
(?i)delete: "yes"
|
(?i)delete: "yes"
|
||||||
|
when: "'innernet-server' in ansible_facts.packages"
|
||||||
|
|
||||||
|
- name: Remove innernet package on server
|
||||||
|
tags: [never, uninstall]
|
||||||
|
apt:
|
||||||
|
name: innernet-server
|
||||||
|
state: absent
|
||||||
|
purge: yes
|
||||||
|
when: "'innernet-server' in ansible_facts.packages"
|
||||||
|
|
||||||
- name: Install innernet package on server
|
- name: Install innernet package on server
|
||||||
tags: [update]
|
tags: [update]
|
||||||
|
Loading…
Reference in New Issue
Block a user