arillso.users

Ansible 角色:用户

重要更新

请注意,ansible.users 角色已被移至新的集合,并且在此仓库中将不再进行积极开发。 有关角色的最新版本,包括新功能和更新,请访问新的集合 https://github.com/arillso/ansible.system/tree/main/roles/users。 我们鼓励所有用户切换到新的集合中的更新角色,以获得持续的支持和改进。

描述

这是一个管理 Linux 和 Windows 上用户及用户授权密钥的 Ansible 角色。

安装

ansible-galaxy install arillso.users

需求

角色变量

用户

要添加的用户列表

users: []
按主机变量添加的用户列表
users_list_host: []

按组变量添加的用户列表

users_list_group: []

示例

users:
  - username: foobar              (必需)
    name: Foo Bar
    uid: 1000
    group: staff
    password: xxxxx               (由 mkpasswd 创建的哈希)
    groups: ["adm", "www-data"]
    append: no                    (仅附加组,保留其他组)
    home_mode: "0750"
    home_create: yes
    home: /path/to/user/home
    system: no
    authorized_keys: []
    authorized_keys_exclusive: yes
    ssh_key_type: rsa
    ssh_key_bits: 2048
    ssh_key_password: ""
    ssh_key_generate: no
    ssh_key: "xxx"
    shell: /bin/bash
    update_password: always
users:
  - username: foobar              (必需)
    name: Foo Bar
    description: 用户
    password: xxxxx
    groups: ['adm', 'www-data']
    hide: true

用户主目录

users_home: /home

用户的默认主组

users_group:

用户的默认次级组

users_groups: []

用户主目录的默认权限

users_home_mode: '0755'

用户的默认 SSH 密钥类型

users_ssh_key_type: rsa

用户的默认 SSH 密钥位数

users_ssh_key_bits: 2048

用户授权密钥的默认独占设置

users_authorized_keys_exclusive: 'no'

依赖关系

示例剧本

- hosts: all
  roles:
    - arillso.users

作者

灵感

许可证

该项目使用 MIT 许可证。有关完整许可证文本,请参见 LICENSE 文件。

版权

(c) 2020, Arillso

关于项目

Role to manage users on Linux and Windows.

安装
ansible-galaxy install arillso.users
许可证
mit
下载
611.8k
拥有者