Ansible role to configure/add a user.
- Ansible 2.7.1
hash_behaviour = merge
Just add the role to your requirements.yml
file:
- src: https://github.com/feffi/ansible-arch-user.git
name: ansible-arch-user
ansible_arch_user: {
# The username/login to set
name: "feffi",
# The password in cleartext to set
password: "SOMEPASSWORD",
# The primary group of the new user
group: "feffi",
# Additional groups the new user belongs to
groups: [
"uucp",
"wheel",
"games",
"rfkill"
],
# The login shell of the user
shell: "/usr/bin/zsh"
}
Example:
- hosts: all
vars:
ansible_arch_user:
# The username/login to set
name: "feffi"
# The password in cleartext to set
password: "SOMEPASSWORD"
# The primary group of the new user
group: "feffi"
# Additional groups the new user belongs to
groups:
- "uucp"
- "wheel"
- "games"
- "rfkill"
# The login shell of the user
shell: "/usr/bin/zsh"
roles:
- { role: ansible-arch-user }