Something like this would work I believe:

"{{ mdb.json.split(':')[1:6] | join(':') }}"

Also, could you not just reference it directly by using "{{ 
mdb.json.mac-address }}"?

On Thursday, March 5, 2020 at 9:52:52 AM UTC-5, David Foley wrote:
>
> Have the Following Playbook Which Returns the following
>
> ok: [localhost] => {
>     "mdb.json": [
>         {
>             "mac-address": "xx:xx:xx:xx:xx"
>         }
>     ]
> }
>
>
> --
> - hosts: localhost
>   gather_facts: false
>   tasks:
>   - name: Getting Mac Address 
>     uri: url="http://.com?field=mac-address"; return_content=yes
>     register: mdb
>   - debug:
>       msg: "{{ mdb.json.split(':') }}"
>
> What i would like to Return is just 
>
>  "msg":  "xx:xx:xx:xx:xx"
>
> But Split doesn't seem to work 
>
>

-- 
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/0776c9b4-d5fd-439c-bdb9-ac1ef03425db%40googlegroups.com.

Reply via email to