Hi,
I have used ansible a lot on the command line and used to do things like this:
ansible -i hosts database -m shell -a ‘mysql --version’ -o
Output will be like:
DBTEST01 | CHANGED | rc=0 | (stdout) mysql Ver 14.14 Distrib 5.7.35, for Linux (x86_64) using EditLine wrapper
DBTEST02 | CHANGED | rc=0 | (stdout) mysql Ver 14.14 Distrib 5.7.35, for Linux (x86_64) using EditLine wrapper
It makes the output easily greppable or easily pasted into spreadsheets etc.
But when I try to do the same sort of thing from AWX I can’t see a way to restrict the output to one line. Is there a way?
I am clicking on Inventory → my-inventory → Groups → Database → Run Command and select shell, and type the command in to Arguments, and I have the ability to change Verbosity, Limit, and Forks, but nothing equivalent to “-o”.
AWX output is in 2-line format which makes it harder to parse:
DBTEST01 | CHANGED | rc=0 >>
mysql Ver 14.14 Distrib 5.7.35, for Linux (x86_64) using EditLine wrapper
DBTEST02 | CHANGED | rc=0 >>
mysql Ver 14.14 Distrib 5.7.35, for Linux (x86_64) using EditLine wrapper
This is a minor detail but causes additional work that the “-o” option would negate.