When running the manage tool as part of scheduled maintainance, eg.
in a cron job, it would be annoying to have to loop over the output
of 'manage list' and call 'manage update' on each of the guests; it
would also mean not taking advantage of Ansible's parallel execution
capabilities, which can speed up things considerably.
Solve the problem by allowing 'all' to be used as a guest name.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
This will not be its own separate commit when pushing, but it will
be squashed into commit 2/5, with a small adjustment required in
commit 3/5 to deal with merge conflicts in the help text.
guests/manage | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/guests/manage b/guests/manage
index d84b8b0..5927d62 100755
--- a/guests/manage
+++ b/guests/manage
@@ -50,11 +50,11 @@ do_help() {
Usage: $PROGRAM_NAME ACTION [OPTIONS]
Actions:
- list List known guests
- install GUEST Install GUEST
- prepare GUEST Prepare or update GUEST. Can be run as many times as needed
- update GUEST Alias for prepare
- help Display this help"
+ list List known guests
+ install GUEST Install GUEST
+ prepare GUEST|all Prepare or update GUEST. Can be run multiple times
+ update GUEST|all Alias for prepare
+ help Display this help"
}
do_list() {
@@ -113,9 +113,9 @@ do_prepare() {
GUEST="$1"
test "$GUEST" || {
- die "Usage: $PROGRAM_NAME prepare GUEST"
+ die "Usage: $PROGRAM_NAME prepare GUEST|all"
}
- do_list | grep -q "$GUEST" || {
+ do_list | grep -q "$GUEST" || test "$GUEST" = all || {
die "$PROGRAM_NAME: $GUEST: Unknown guest"
}
--
2.13.6