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/20200706165717.0fa53926%40gmail.com.

Attachment: pgpghlnoi_M81.pgp
Description: OpenPGP digital signature

Reply via email to