I'm writing an Ansible play to automate new user creation in 100+ Unix servers. I've got the part right where it creates an user and assigns password. But our organization hardening policy demands, whenever a new user is added, username must be updated in "AllowUsers" parameter of sshd_config file. I'm new to Ansible and have no clue how to get this done.
Here's "AllowUsers" section of sshd_config file.
AllowUsers root user1 user2 user2
This is how it should be after adding a new user "testuser"
AllowUsers root user1 user2 testuser