Hi
I've been thinking what is the best ways of presenting actual command line
"row" of the ansible/ansible-playbook execution.
It could be captured 'before execution' with a simple echo, but sometimes
the escaping breaks the result (see the example below).
The easiest what I've found is just adding print into ansible-playbook
script.
Before I do pull request, etc. - what do You think about it. Any better,
easier, or ready-to-use solution?
Note, that presenting args after being parsed with argparse may destroy the
view, I do not also wan't to see variables form vault that may be parsed
along way. Just CLI exec+arguments.
ansible-playbook
def main(args):
''' run ansible-playbook operations '''
*print args*
(...)
Result:
$ ansible-playbook -i ~/ansible/etc/inv/inventory
etc/playbooks/playbook.yml -e
"system_version=../system_version/prd_default" -D -e '{"some_key":
{"some_other_key": "x12"}}'
['-i', '/home/useri/ansible/etc/inv/inventory',
'etc/playbooks/playbook.yml', '-e',
'system_version=../system_version/prd_default', '-D', '-e', '{"some_key":
{"some_other_key": "x12"}}' ]
^^ this result is enough :) If we could have the exact CLI (for further
copy-paste execution) would be even better
Broken escaping example:
$ echo ansible-playbook -i ~/ansible/etc/inv/inventory
etc/playbooks/playbook.yml -e
"system_version=../system_version/prd_default" -D -e '{"some_key":
{"some_other_key": "x12"}}'
ansible-playbook -i /home/user/ansible/etc/inv/inventory
etc/playbooks/playbook.yml -e system_version=../system_version/prd_default
-D -e {"some_key": {"some_other_key": "x12"}}
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/f0b724db-b057-4475-847f-be3d38ed1010%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.