ansible/ansible — pull request #7249 by jfchevrette (2014-05-01 21:02:31+00:00)
Title: Allow group module to handle check_mode properly when group.state=present and group already exists

The Group.group_mod function always returns (True, '', '') [1] when check_mode is True which is in turn failing the task when requesting group.state = present and group already exists [2]

I compared both user and group modules which are working in a similar way and the proposed fix handles this case much like the user module does.

[1] https://github.com/ansible/ansible/blob/devel/library/system/group#L123-L124
[2] https://github.com/ansible/ansible/blob/devel/library/system/group#L123-L124