From a7b70bd8c58a88c2b88af34314db11a8e2f14de9 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Wed, 4 May 2022 01:15:12 +0300 Subject: [PATCH] Refactor(cleanup-tmp.sh): Use `ansible --list-hosts` instead of `run-hosts -L` --- playbooks/ansible/cleanup-tmp.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/playbooks/ansible/cleanup-tmp.sh b/playbooks/ansible/cleanup-tmp.sh index af8ba20..1fdefca 100755 --- a/playbooks/ansible/cleanup-tmp.sh +++ b/playbooks/ansible/cleanup-tmp.sh @@ -1,9 +1,11 @@ #! /bin/sh +hosts="`\"$HOME\"/.virtualenvs/ansible/bin/ansible --list-hosts servers | tail -n +2`" + echo localhost rm -rf "$HOME"/.ansible/tmp/\* -for host in `run-hosts -L`; do +for host in $hosts; do echo $host ssh $host exec rm -rf .ansible/tmp/\* done -- 2.39.2