Missing group prior to user creation
pierrepo opened this issue · comments
Pierre Poulain commented
The user creation task failed if groups are not created:
$ ansible-playbook users.yml -i hosts.old -u ubuntu -e @users-config.yml
|...]
TASK [Add users] *******************************************************************************************************************************************************************************
Monday 22 June 2020 22:03:21 +0200 (0:00:02.859) 0:00:02.911 ***********
failed: [51.68.113.239] (item={'name': 'claire2', 'password': 'claire'}) => {"ansible_loop_var": "item", "changed": false, "item": {"name": "claire2", "password": "claire"}, "msg": "Group claire2 does not exist"}
failed: [51.68.113.239] (item={'name': 'sandrine2', 'password': 'sandrine'}) => {"ansible_loop_var": "item", "changed": false, "item": {"name": "sandrine2", "password": "sandrine"}, "msg": "Group sandrine2 does not exist"}
[...]
If passed to ansible, user groups need to exist.
Jeremy Tuloup commented
Do you think groups should be created automatically when executing the users playbook if they don't already exist?
Jeremy Tuloup commented
OK let's discuss this in #165