Ansible playbook for configuring access like another user

When you want User B to have the same groups, ssh access, and sssd permissions, use this playbook.

It depends on a few files from the bgscripts package for now. Maybe someday I’ll make some ansible modules for ssh_allowusers: allowed=yes name=”{{ item }}” and sssd_allow_users.

You’ll need these:



I needed to query certain information about a user on a Linux system. Specifically this output:

user: bgstack15
getent: YES
getent_type: sss
can_ssh: YES
can_sss: YES

I wanted to know if a user is defined (getent), and if so, in which database (local or in Active Directory). Also, is the user in the AllowUsers list of the sshd_config, or a member of a group in the AllowGroups list. And then the same question for the sssd config file.

The script