Skip to content

Latest commit

 

History

History
78 lines (60 loc) · 1.95 KB

README.md

File metadata and controls

78 lines (60 loc) · 1.95 KB

Ansible Role - havlasme.linux.user

Apache-2.0 license

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

Role Variables

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')

Dependencies

Ansible.Posix

ansible-galaxy collection install ansible.posix

Example Playbook

- hosts: 'all'
 
  tasks:
  - ansible.builtin.include_role:
      name: 'havlasme.linux.user'
    vars:
      linux_user:
      - name: 'root'
        password_lock: true

License

Apache-2.0

Author Information

Created in 2024 by Tomáš Havlas.