All checks were successful
checks-test / Lint (push) Successful in 16s
checks-test / molecule (debian11) (push) Successful in 2m11s
checks-test / molecule (debian13) (push) Successful in 2m21s
checks-test / molecule (rockylinux10) (push) Successful in 2m19s
checks-test / molecule (debian12) (push) Successful in 2m43s
checks-test / molecule (rockylinux9) (push) Successful in 1m55s
checks-test / molecule (ubuntu2204) (push) Successful in 1m47s
checks-test / molecule (ubuntu2404) (push) Successful in 1m54s
Reviewed-on: #5 Co-authored-by: Mykhailo Nikiforov <mn@palkoi.net> Co-committed-by: Mykhailo Nikiforov <mn@palkoi.net>
Role Name
This role will create required groups/users for you
Role Variables
This role using the following variables:
users_groups:
admin: # group name
gid: 1000 # group id (optional)
users:
admin: # user name
shell: /bin/bash
uid: 1000 # user id (optional)
groups:
- admin
- remote-users
passwords:
# Generate password hashes with openssl passwd -6 -salt <salt> <password>
default: $6$xyz$nz7SVil2FgVuZ4wjm/1PO31S1QyGBUPVClD55.anfY2pEjs9fUXceRVGsghlUh2I9Jsc2awuh94KOXmNJTcv.0 # This is a default password, it'll be used if no more specific password is specified
'192.168.0.10': $6$xyz$nz7SVil2FgVuZ4wjm/1PO31S1QyGBUPVClD55.anfY2pEjs9fUXceRVGsghlUh2I9Jsc2awuh94KOXmNJTcv.1 # Password for this exact host. IP is discovered dynamically by ansible
authorized_keys:
default:
key: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIAxFJolWPmbFVMMyD9kxQb353ngyUsEebgkK9AcnjOI cardno:13_460_390' # Your ssh key
state: 'present' # state is optional, 'present' is a default
Example Playbook
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: servers
roles:
- role: palkx.users
vars:
users_groups:
admin:
gid: 1050
remote-users:
gid: 856
users:
admin:
shell: /bin/bash
uid: 1000
groups:
- admin
- remote-users
passwords:
# Generated with openssl passwd -6 -salt xyz testpass
default: $6$xyz$nz7SVil2FgVuZ4wjm/1PO31S1QyGBUPVClD55.anfY2pEjs9fUXceRVGsghlUh2I9Jsc2awuh94KOXmNJTcv.0
authorized_keys:
default:
key: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIAxFJolWPmbFVMMyD9kxQb353ngyUsEebgkK9AcnjOI cardno:13_460_390'
License
BSD
Author Information
Maintained by palkx
Languages
Makefile
100%