Automating your Linux user management (local user and group) with Ansible enables you to achieve Infrastructure As Code (IaC). Using IaC you’re going to be able to automate your workflow, your CI/CD pipelines for example, and be faster about your critical business demands.
Beginners
Ansible provides various modules to manage user management (local user and group). I’ll show you step by step how to prepare your Ansible controller to interact with the Linux user and group directory. This initial configuration sometimes is a roadblock for some Docker users to start using Ansible.
User management
- Create user account - Ansible module user
- Add a User to a Second Group on Linux - Ansible module user " >}})
- Change the User Primary Group on Linux - Ansible module user
- Change user password - Ansible module user.md
- User password expiration - Ansible module user
- Enable user account - Ansible module user.md
- Disable user account - Ansible module user
- Remove user account - Ansible module user
Group management
PostgreSQL
- Allow md5 Connection for a PostgreSQL User or Role - Ansible module postgresql_pg_hba
- Create a PostgreSQL User or Role - Ansible module postgresql_user
- Grant Privileges to User or Role on PostgreSQL Database - Ansible module postgresql_privs
Windows
- Change local user password on Windows-like systems - Ansible module win_user.md
- Create a local group on Windows-like systems - Ansible module win_group.md
- Create a local user on Windows-like systems - Ansible module win_user
- Remove a local group on Windows-like systems - Ansible module win_group.md
- Remove a local user on Windows-like systems - Ansible module win_user.md
AWX
Troubleshooting
- Ansible troubleshooting - This command has to be run under the root user
- Ansible troubleshooting - Unhandled exception while executing module win_user
- Ansible troubleshooting - user module bug.md
The Best Resources Ansible For Containers (Docker, Podman, Kubernetes and OpenShift)
Video Course
eBook
Conclusion
Now you know how you could automate your Linux user management (local user and group) using Ansible Automation technology. Subscribe to the YouTube channel, Medium, and Website, X (formerly Twitter) to not miss the next episode of the Ansible Pilot.
Academy
Learn the Ansible automation technology with some real-life examples in my Udemy 300+ Lessons Video Course.
My book Ansible By Examples: 200+ Automation Examples For Linux and Docker System Administrator and DevOps
Donate
Want to keep this project going? Please donate