diff --git a/playbooks/roles/openvpn-install-connector/tasks/Debian.yml b/playbooks/roles/openvpn-install-connector/tasks/Debian.yml index d8dd22d3..e21446d8 100644 --- a/playbooks/roles/openvpn-install-connector/tasks/Debian.yml +++ b/playbooks/roles/openvpn-install-connector/tasks/Debian.yml @@ -1,13 +1,19 @@ --- - name: delete sessions shell: | + set -x for path in $(sudo openvpn3 sessions-list | grep -o '\S*/net/openvpn/\S*'); do sudo openvpn3 session-manage --path ${path} --disconnect; done become: yes + register: shell + changed_when: shell.stdout - name: delete configs shell: | + set -x for path in $(sudo openvpn3 configs-list | grep -o '\S*/net/openvpn/\S*'); do sudo openvpn3 config-remove --path ${path} --force; done become: yes + register: shell + changed_when: shell.stdout #- name: install connector # shell: |