try removing quotes in stdout
On Wed, Apr 21, 2021 at 3:34 PM Vikram S <[email protected]> wrote: > > I wrote below script to parse output of 'sh flash:' however iam getting > blank output. > > I checked several examples and i seem to be following the format properly > yet doesn't work. What am i doing wrong? > > *SCRIPT:* > ios_command: > commands: "show flash:" > > register: show_space > > name: Pass text and template_path > ansible.utils.cli_parse: > text: "{{ show_space['stdout'] }}" > parser: > name: ansible.utils.ttp > template_path: "templates/sample.ttp" > > register: parser_output > > name: Display facts > debug: > msg: "{{ parser_output.parsed }}" > > *TTP TEMPLATE:* > cat nano templates/sample.ttp > Directory of {{ path }} > {{ bytes_total }} bytes total ({{ bytes_free }} bytes free) > ---------------------------------------------------------------------- > *OUTPUT:* > TASK [Display facts] ***************************************************** > ok: [TEST2960] => { > "msg": [ > [ > {} > ] > ] > } > > Thanks, > Vikram > > -- > 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 view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/14299988-a84c-468f-ac83-b89bf461f7ccn%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/14299988-a84c-468f-ac83-b89bf461f7ccn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Thanks, Pushparaj G -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAE5Yv1S0ca_bCcSCObbsGqzGE2-p2TjAASYpy_3nyYxyvaApoQ%40mail.gmail.com.
