ansible 常用模块 group

 


参数

参数 选项/默认值 描述
gid
interger
  要为组设置的可选 GID。
local
boolean
  • false ←(默认)

  • true

强制在实现它的平台上使用“local”命令替代项。
这在要操作本地组时使用集中式身份验证的环境中非常有用。(例如,它使用 代替lgroup addgroupadd )。
name
string
required
  要管理的组的名称。
non_unique
boolean
  • false ←(默认)

  • true

此选项允许将组 ID 更改为非唯一值。需要gid
在苹果操作系统或BusyBox上不受支持。
state
string
  • "absent"

  • "present" ←(默认)

该组是否应存在于远程主机上.
system
boolean
  • false ←(默认)

  • true

如果是,则表示创建的组是系统组

示例

- name: Ensure group "somegroup" exists
  ansible.builtin.group:
    name: somegroup
    state: present

- name: Ensure group "docker" exists with correct gid
  ansible.builtin.group:
    name: docker
    state: present
    gid: 1750

参考文档

https://docs.ansible.com/ansible/latest/collections/ansible/builtin/group_module.html#group-module

posted @   小吉猫  阅读(42)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· winform 绘制太阳,地球,月球 运作规律
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)
点击右上角即可分享
微信分享提示