alysoid / ansible-users

Manage system users and groups

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Catena Ansible Role: users

Manage system users and groups.

Role variables

See defaults/main.yml for details.

catena_users

It uses ansible.builtin.user and ansible.posix.authorized_key modules in combination.

# Example
catena_users:
  - username: satoshi
    password: "{{ password }}"
    # Description (aka Gecos) of user account
    # https://www.redhat.com/sysadmin/linux-gecos-demystified
    comment: Satoshi Nakamoto
    # Comma separated groups user will be added to
    # When empty '', the user is removed from all groups
    groups: adm,sys
    shell: /bin/bash
    authorized_keys:
      - key: "{{ lookup('file', '~/.ssh/id_ed25519.pub') }}"
        state: present
    # Remove the user account when state is 'absent'
    remove: no
    state: present

catena_groups

It uses ansible.builtin.group module.

# Example
catena_groups:
  - name: backup
    state: absent
  - name: bitcoin
    state: present
    gid: 2009

About

Manage system users and groups

License:MIT License


Languages

Language:YAML 100.0%