Commit 0bc8dbc2 authored by nanahira's avatar nanahira

fix remove-interface

parent 2021d775
- name: '{{conn.name}}: stop wireguard'
become: true
ignore_errors: true
systemd:
name: 'wg-quick@{{conn.name}}'
state: stopped
enabled: no
- name: '{{conn.name}}: tasks for {{conn.ocType}}'
include_tasks: './configure-{{conn.ocType}}.yaml'
#!/bin/bash
INTERFACE=$1
TARGET=$2
if [[ -z "$TARGET" ]]; then
TARGET=wg
fi
COMMAND="flush interface ${INTERFACE}\nquit"
COMMAND_BASE64=$(echo -e "$COMMAND" | base64 -w 0)
cd ansible
ansible wg -m shell -b -a "wg-quick down ${INTERFACE} ; echo $COMMAND_BASE64 | base64 --decode | timeout 1 nc ::1 33123"
ansible wg -m systemd -b -a "name=wg-quick@${INTERFACE} state=stopped enabled=false"
ansible "$TARGET" -m shell -b -a "wg-quick down ${INTERFACE} ; echo $COMMAND_BASE64 | base64 --decode | timeout 1 nc ::1 33123"
ansible "$TARGET" -m systemd -b -a "name=wg-quick@${INTERFACE} state=stopped enabled=false"
ansible "$TARGET" -m docker_compose -a "project_src=~/nextgen-network/services services=openconnect-${INTERFACE} stopped=true"
cd ..
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment