saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt software package repository here:
https://repo.saltproject.io/
Apache License 2.0
14.15k stars 5.47k forks source link

Print the result of salt batch in real time. #31674

Closed kstreee closed 8 years ago

kstreee commented 8 years ago

The salt commands with a batch option, for example salt -b 10 '*' test.ping, print a result after all minions are finished their job. It is uncomfortable to use because I couldn't figure out how many minions are finished or not finished. I think that it could more convenient if the salt commands with batch option show each minion's result right after finished their job just like salt '*' test.ping.

jfindlay commented 8 years ago

@kstreee, thanks for reporting. Have you tried specifying the outputter on the command line? Based on my reading of the code, you should be able to override the default outputter on the command line, and also probably change the default in the config file.

To get a list of builtin outputters, run salt --help | grep -A 5 -- --output=OUTPUT:

    --out=OUTPUT, --output=OUTPUT
                        Print the output from the 'salt' command using the
                        specified outputter. The builtins are 'key', 'yaml',
                        'overstatestage', 'highstate', 'newline_values_only',
                        'pprint', 'txt', 'raw', 'virt_query', 'compact',
                        'json', 'nested', 'quiet', 'no_return'.
kstreee commented 8 years ago

@jfindlay It works very well! Thank you for your advice! Now we can evaluate how many minions are remained when we run salt commands with a batch option for multi thousand minions. :)

jfindlay commented 8 years ago

@kstreee. Nice. You can also setup a custom returner as the master job cache and use that external system to watch the completion of state runs.

kstreee commented 8 years ago

@jfindlay We know about the returners, but we are not ready to use external returner yet. Thank you for your advice! :)