Hi Junaid,

You can convert stdout to json using `jq` binary and `from_json` filter 
like -

  tasks:
    - name: local
      local_action:
        shell
        chdir=/Volumes/data/src/ansible/
        git log --pretty='["%h", "%an", "%ae", "%ad", "%s"]' | head -1 | jq
      register: local_commit_info

    - set_fact:
        m: "{{ local_commit_info.stdout | from_json }}"

    - debug:
        msg: "{{ m[1] }}"

You can `m` directly in your next call.


-- 
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/688f9be2-df9f-4978-8045-10e788c77055%40googlegroups.com.

Reply via email to