You can use the `getent` module to do this.  Something like:

- getent:
    database: group

- assert:
    that:
      - getent_group.wheel|default(["", "", ""])[2] == ""

On Tue, Apr 2, 2019 at 11:22 AM Jon Adcock <[email protected]> wrote:

> I'm trying to add a task to my security playbook to ensure that there are
> no members in the default Linux wheel group.  This has turned out to be
> more difficult than I thought it would be.
>
> Can someone out there help get me started?  (ansible 2.7.9)
>
> --
> 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 post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/8eb57467-d348-4ca3-a013-9b8b9ac01235%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/8eb57467-d348-4ca3-a013-9b8b9ac01235%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Matt Martz
@sivel
sivel.net

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAD8N0v-s3JtKqZX42a7sVe5rV1B75t7SYAcmpzFPYFfqsv4S2Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to