Hi Team
I get below error when I use split directly,

The error was: 'list object' has no attribute 'split'

How to unlist in ansible


Best Regards
Jenisha T
Whatsapp: +91 07598087866





On Mon, 6 Jul 2020 at 20:27, Vladimir Botka <[email protected]> wrote:

> On Mon, 6 Jul 2020 04:44:18 -0700 (PDT)
> Jenisha T <[email protected]> wrote:
>
> > extract first value* anil *before (':')
> >
> >     "msg": "*anil*:x:500:500:Anil:/home/anil:/bin/bash
> >
>
>        user_name: "{{ my_string.split(':')[0] }}"
>
> This is the correct expression, given the data is in the variable
> "my_string",
> wherever it might come from.
>
> --
> Vladimir Botka
>

-- 
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/CAAGhZYj0ksGSgcyXJeQYezWjPTuGt9yA9AptqRWuwYhnt_92cg%40mail.gmail.com.

Reply via email to