From b200ec44bd866dec3dca6d84f17f8875e88676eb Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Thu, 28 Jan 2021 00:00:09 +0100 Subject: [PATCH] Update to 2021-01-28 00:00 --- roles/coturn/tasks/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/coturn/tasks/main.yml b/roles/coturn/tasks/main.yml index 11fc057..3422aa5 100644 --- a/roles/coturn/tasks/main.yml +++ b/roles/coturn/tasks/main.yml @@ -100,16 +100,16 @@ - name: Remove users with unknown realm shell: | - for U in $(turnadmin --list | grep -v '\[{{ turn_realm | default(ansible_domain) }}\]'); do + for U in $(turnadmin --list | grep -vP '^0:\s+:\s+(log file opened|SQLite connection)'); do user=$(echo $U | cut -d'[' -f1) realm=$(echo $U | perl -pe 's/.*\[(.*)\]/$1/') - turnadmin --delete --user=$user --realm=$realm + [ "$realm" == "{{ turn_realm | default(ansible_domain) }}" ] || turnadmin --delete --user=$user --realm=$realm done changed_when: False tags: turn - name: List long term users - shell: turnadmin --list | grep -vP '^0:\s+(log file opened|SQLite connection)' | cut -d'[' -f1 + shell: turnadmin --list | grep -vP '^0:\s+:\s+(log file opened|SQLite connection)' | cut -d'[' -f1 register: turn_lt_existing_users changed_when: False tags: turn