# Ansible role for creating OS user Create user and optionally put user into sudoers. By default, user is added to ssh_access group. Group will be created if not exist. URL: https://xpk.headdesk.me/git/xpk/role.users ## Required variables: ``` user: name: john group: clientadmin pwhash: sha512 hash sudoers: yes/no ``` ## Usage: Create a playbook like this ``` --- - name: create user user1 hosts: me become: yes roles: - role: users vars: user: name: user1 group: staff pwhash: "$6$fqpO..." sudoers: yes ``` ## How to generate pwhash ```mkpasswd -m sha-512``` Or genpw.py which generates random password and a hash at the same time. ## Tested on - RHEL7 - CentOS7 - Ubuntu18