https://github.com/aboutbits/ansible-user
Ansible - User Role
https://github.com/aboutbits/ansible-user
ansible ansible-role user
Last synced: 8 days ago
JSON representation
Ansible - User Role
- Host: GitHub
- URL: https://github.com/aboutbits/ansible-user
- Owner: aboutbits
- Created: 2020-04-22T12:57:51.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2025-05-08T09:53:59.000Z (about 1 year ago)
- Last Synced: 2025-08-30T12:05:44.612Z (10 months ago)
- Topics: ansible, ansible-role, user
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
Ansible User Role
=================
User creation role.
## Role Variables
- `user_name`: The name of the user
- `user_password`: The password for the user
- `user_groups`: The groups of the user
- `user_authorized_keys`: The authorized keys of the user
## Example Playbook
```yaml
- hosts: all
tasks:
- ansible.builtin.include_role:
name: ansible-user
vars:
user_name: alex
user_password: sha512-hashed-password
user_groups:
- docker
user_authorized_keys:
- {{ lookup('file', 'path-to-key') }}
```
## Password
To create a password hash for a user, the following command must be extecuted:
```
mkpasswd --method=SHA-512
```
The command is contained within the package "whois" that can be installed on
Linux by executing `apt-get install -y whois`.
## Build & Publish
To build and publish the role, visit the GitHub Actions page of the repository and trigger the workflow "Release Package" manually.