getent group

HI team,

I have to check the group via getent if the group is not present I have to create a new group. how can I mention this is when module

Try using the examples at https://docs.ansible.com/ansible/latest/user_guide/playbooks_conditionals.html?highlight=register#register-variables

You don't need to check if the group exist, the group module will create the group if it doesn't exist and if it exist it will not do anything.

Thanks Kai this is what I am looking for …