Based on your data, look at this module: https://docs.ansible.com/ansible/latest/modules/getent_module.html
On Mon, 6 Jul 2020 at 13:44, Jenisha T <[email protected]> wrote: > > Hi > Could you pls help me with the splitting value from the list. I need to > extract first value anil before ('':') > > grep_atm.stdout_lines output below > > ok: [localhost] => { > "msg": "anil:x:500:500:Anil:/home/anil:/bin/bash > " > } > > I tried, > - set_fact: > user_name: "{{ grep_atm.stdout_lines }}" > register: user_name.split(':')[0] > - debug: > var: user_name.split(':')[0] > > -- > 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/42fb2917-8336-42a2-979a-44573e91fd77n%40googlegroups.com. -- Dick Visser Trust & Identity Service Operations Manager GÉANT -- 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/CAL8fbwNuqWXVNjms%3DaAcLs%2BppZitE%3DrzLjdP9fQJDdsDq-jXuw%40mail.gmail.com.
