ansible-group模块使用方法

应用

管理远程主机上的组

参数

  • name:指定组的名称
  • state present|absent:指定组的状态
  • gid:指定组的gid

示例

  1. 创建test组
]# ansible all -m group -a 'name=test'
  1. 删除test组,前提是不能有用户把删除的组涂当成主组
]# ansible all -m group -a 'name=test state=absent'
  1. 将test组的gid设置为2000
]# ansible all -m group -a 'name=test gid=2000'

猜你喜欢

转载自www.cnblogs.com/wanwz/p/12922464.html