Why you are using ls -l command and
For checking user group use below  command
# id username | grep -i groupname

Regard
Gg

On Tue, 21 Jul 2020, 17:49 Jenisha T, <[email protected]> wrote:

> Hi Team
>
> I want to execute ls -l command twice.
>
> 1. ls -l # check if user in group
> 2. sudo adduser user_name new_group # If not in group add user to group
> 3. ls -l # Check if user added to group
>
> Is there a way I can write a shell module for $ ls -l once and call for
> step 1 and step 3  in ansible
>
> Thankyou!
>
> --
> 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/55b0c249-8f63-41e6-bac3-4a9c3e90abfbn%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/55b0c249-8f63-41e6-bac3-4a9c3e90abfbn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAG_8SgMYJFVq2cp_4kWZfC1u5z1ZQj3w-fXjO8xvD5GD%3DQG91Q%40mail.gmail.com.

Reply via email to