An Ansible role to manage linux system users and associated authorized keys on Debian and Ubuntu running systemd.
- Create, Update, and Delete a Linux User
- Create, Update, and Delete a User-Associated Authorized Key
Available variables are listed below, along with default values (see defaults/main.yml
):
# linux user list
linux_user: [ ]
## - name: string
## comment: string | d(omit)
## home: string | d(omit)
## create_home: boolean | d(omit)
## local: boolean | d(omit)
## password: string | d(omit)
## password_lock: boolean | d(omit)
## shell: string | d(omit)
## system: boolean | d(omit)
## uid: int | d(omit)
## umask: string | d(omit)
## group: string | d(omit)
## groups: string[] | d(omit)
## append: boolean | d(omit)
## state: enum('present', 'absent') | d('present')
## authorized_key: dict[] | d(omit)
## - key: string
## key_options: string | d(omit)
## comment: string | d(omit)
## exclusive: boolean | d(omit)
## state: enum('present', 'absent') | d('present')
ansible-galaxy collection install ansible.posix
- hosts: 'all'
tasks:
- ansible.builtin.include_role:
name: 'havlasme.linux.user'
vars:
linux_user:
- name: 'root'
password_lock: true
Created in 2024 by Tomáš Havlas.