users
ANSIBLE-ROLE-USERS
Ansible role create users with ssh pub key.
NO PRIVATE KEY
If you need to create a group, I have separeted this action with redbeard28.groups galaxy role
Howto use this role?
This role need to be include in a playbook.
Call this Galaxy role like this:
ansible-galaxy install -r requirements.yml
Inside requirements.yml
# from GitHub, overriding the name and specifying a specific tag
- src: redbeard28.users
More info => Ansible Docs
Requirements
- Ansible 2.9+
Role Variables
state* means ansible value: present or absent
---
users:
- { state: 'present', name: 'myname', group: 'mygroup', password: {{ vault_password | password_hash('sha512') }}, key: {{ vault_ssh_pub_key }}, shell: '/bin/ksh', homepath: '/home' }
Dependencies
- redbeard28.groups if group do not exist
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: all
roles:
- { role: redbeard28.users, tags: mytags }
Molecule testing framework
You can use molecule to test this role.
image=debian tag="buster" molecule converge
image=debian tag="buster" molecule verify
Author Information
Jeremie CUADRADO¹ from Redbeard-Consulting
About
Ansible role create users with ssh pub key. NO PRIVATE KEY
Install
ansible-galaxy install redbeard28/ansible-role-users
License
Unknown
Downloads
122
Owner