ansible-training

lab.usersandgroups

This Ansible role facilitates the management of users and groups on Linux/Unix systems. It allows for the creation, modification, and removal of users and groups, supporting a wide range of configurations including setting user passwords, managing home directories, and configuring user-specific SSH access.

Requirements

Role Variables

This role uses the following variables to manage users and groups. These variables should be defined in your playbook under the vars section or in separate variables files.

General Variables

User Attributes

Group Attributes

Dependencies

None.

Example Playbook

- hosts: all
  become: yes
  roles:
    - labs.usersandgroups
  vars:
    users_list:
      - name: johndoe
        state: present
        password: "password123"
        groups: ["wheel", "developers"]
        ssh_key: ""
    groups_list:
      - name: developers
        state: present

License

MIT / BSD

Author Information

This role was created in 2024 on Ansible Training Labs