I created a new group in OS. Now I want to assign 5 or more existing users to that group using ansible. I believe I could do this for single user.
---
- name: add user to a group
become: 'yes'
become_method: sudo
hosts: all
tasks:
- user:
name: myusername
groups: new_group
append: yes
...
I want to assign all users to that group in one go instead of running the script several time with different username each time.