manala.accounts
#######################################################################################################
:exclamation: 弃用通知 :exclamation:
这个仓库及其相关角色已弃用,建议使用 Manala Ansible Collection
您可以在 集合仓库 中找到其使用信息。
#######################################################################################################
Ansible 角色: Accounts 
:exclamation: 报告问题 并 发送拉取请求 到 主 Ansible 角色仓库 :exclamation:
这个角色将处理用户、组账户和 SSH 密钥的设置。
它是 Manala Ansible Stack 的一部分,但也可以作为独立组件使用。
要求
无。
依赖关系
无。
安装
Ansible 2+
使用 ansible galaxy 命令行工具:
ansible-galaxy install manala.accounts
使用 ansible galaxy 需求文件:
- src: manala.accounts
角色处理器
无
角色变量
名称 | 默认值 | 类型 | 描述 |
---|---|---|---|
manala_accounts_users |
数组 | 数组 | Unix 用户列表。 |
manala_accounts_users.user |
- | 字符串 | 用户名。 |
manala_accounts_users.group |
- | 字符串 | 用户的主组。 |
manala_accounts_users.groups |
- | 数组 | 用户的次要组数组。 |
manala_accounts_groups |
- | 数组 | 要创建的组数组。 |
manala_accounts_groups.name |
- | 字符串 | 要管理的组的名称。 |
manala_accounts_groups.system |
- | 布尔值 | 如果为真,则表示创建的组是系统组。 |
定义用户
manala_accounts_users
键允许通过以下方式定义我们的用户:
- 用户名
- 主组
- 一些次要组
- 一些独占的授权密钥
- 一些私有/公有密钥
示例
manala_accounts_users:
- user: foo
group: users
groups: ['sudo']
authorized_keys_file: authorized_keys2 # 默认是 authorized_keys
authorized_keys:
- "{{ query('file', playbook_dir ~ '/files/users/keys/[email protected]') }}"
- "no-port-forwarding,from=\"10.0.1.*\" {{ query('file', playbook_dir ~ '/files/users/keys/[email protected]') }}"
keys:
- name: id_rsa
public: "{{ query('file', playbook_dir ~ '/files/users/keys/[email protected]') }}"
private: "{{ query('file', playbook_dir ~ '/files/users/keys/[email protected]') }}"
gpg_keys:
- key: FOOOBAAR
public: "{{ query('file', playbook_dir ~ '/files/users/gpg_keys/[email protected]') }}"
secret: "{{ query('file', playbook_dir ~ '/files/users/gpg_keys/[email protected]') }}"
示例:确保用户不存在
manala_accounts_users:
- user: bar
state: absent
# 扁平化用户
- "{{ my_custom_users_array }}"
示例:信任 GPG 密钥
- user: root
gpg_keys:
- key: foobar
public: "{{ query('file', playbook_dir ~ '/files/foobar.gpg.key') }}"
trust: true
创建组
您可以通过使用 manala_accounts_groups
创建自己的组,指定:
- 组名
- 该组是否为 "系统组"
示例
manala_accounts_groups:
- group: ops
system: false
# 扁平化组
- "{{ my_custom_groups_array }}"
示例剧本
- hosts: servers
roles:
- role: manala.accounts
许可证
MIT
作者信息
Manala (http://www.manala.io/)
安装
ansible-galaxy install manala.accounts
许可证
Unknown
下载
6.7k
拥有者
Manala is an open source project supported by the french web agency ELAO providing advanced ansible roles for website's infrastructures and far more.