From 1a222ee90fb0708799f89f3306a9641a94111876 Mon Sep 17 00:00:00 2001 From: whirigoyen Date: Wed, 6 Jul 2022 15:26:10 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20exemple=20commande=20pour=20lister=20le?= =?UTF-8?q?s=20serveurs=20qui=20ont=20un=20paquet=20install=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HowtoAnsible.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/HowtoAnsible.md b/HowtoAnsible.md index 6455d524..3ee20e4f 100644 --- a/HowtoAnsible.md +++ b/HowtoAnsible.md @@ -77,12 +77,18 @@ mon-serveur | SUCCESS | rc=0 >> jeudi 26 mai 2016, 23:16:01 (UTC+0200) ~~~ -Quelques exemples de commandes pratiques : +Par exemple, pour lister les serveurs qui ont le packet `lxc` installé : ~~~ +$ ansible stretch,buster,bullseye -bK --one-line --forks 42 -m command --args 'dpkg -l | grep lxc | grep -q ii' | grep CHANGED +~~~ + +Autres exemples pratiques : + +~~~ +$ ansible stretch,buster -bK --one-line --forks 42 -m command --args "grep -r SFTPEngine /etc/proftpd" $ ansible "*" -bK --one-line --forks 42 -m command --args "grep foo /etc/passwd" $ ansible "*" -bK --one-line --forks 42 -m command --args "lxc-ls" | grep CHANGED -$ ansible stretch -bK --one-line --forks 42 -m command --args "grep -r SFTPEngine /etc/proftpd" ~~~