My question on stdout[0] is specific to below output. As i understand from 
ansible documentation, stdout means that it quotes the output of a variable 
and [0] means referencing the first char or command. I am just trying to 
figure out how the definition relates to what it does in below script.


The output of show flash: is stored in custom variable called show_flash 
shown below. 1st script below contains .stdout[0] after name of custom 
variable whereas 2nd script does not. I am trying to understand 
how stdout[0] affects the output the way it does given it's above meaning?

**even though below syntax may not appear in correct format, it is properly 
formatted when executed and i get no error, just a different kind of 
output**


*SCRIPT 1:*

    - name: Pass text and template_path

      ansible.utils.cli_parse:

        text: "{{ show_flash.stdout[0] }}"

        parser:

          name: ansible.utils.ttp

          template_path: "templates/sample2.ttp"'''


*OUTPUT:*

TASK [Display facts]

ok: [ROUTER] => {

   "msg": [

        [

            {

            "flash:/": {

                "bytes_free": 22840320,

                "bytes_total": 122185728


*script 2:*

  - name: Pass text and template_path

    ansible.utils.cli_parse:

      text: "{{ show_flash }}"

      parser:

      name: ansible.utils.ttp

      template_path: "templates/sample2.ttp"


*OUTPUT:*

TASK [Display facts] 

ok: [ROUTER] => {

    "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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/08eeaf92-d84d-4466-8bd2-3f3186971ab4n%40googlegroups.com.

Reply via email to