On Thursday, March 5, 2020 at 8:48:12 PM UTC, Kai Stian Olstad wrote:
>
> On 05.03.2020 15:52, David Foley wrote:
> > Have the Following Playbook Which Returns the following
> >
> > ok: [localhost] => {
> > "mdb.json": [
>
> The [ is telling us that mdb.json is a list, the fist element in a list
> i 0.
>
> > {
> > "mac-address": "xx:xx:xx:xx:xx"
> > }
> > ]
> > }
>
> <snip />
>
> > - debug:
> > msg: "{{ mdb.json.split(':') }}"
> >
> > What i would like to Return is just
> >
> > "msg": "xx:xx:xx:xx:xx"
>
> That would be {{ mdb.json.0['mac-address'] }}
>
> because of the dash in mac-address you need to use [] notation and not
> the dot notation on that one.
>
>
> --
> Kai Stian Olstad
>
Thanks Kai,
that worked i was also able to Split('-')[0] and that only outputted the
xxx:xxx:xxx:xx just what i was looking for.
--
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/6ada225d-044c-41d8-9def-a2add77d7b48%40googlegroups.com.