0
点赞
收藏
分享

微信扫一扫

ansible模块--groups模块


group组模块,创建组,管理组
name:指定组
gid:指定gid
state=absent 删除指定组
1.创建组并指定gid

[root@ansible ansible]# ansible -i hosts mysql -m group -a 'name=group1 gid=5000'
192.168.56.88 | CHANGED => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": true,
"gid": 5000,
"name": "group1",
"state": "present",
"system": false
}

2.删除组

[root@ansible ansible]# ansible -i hosts mysql -m group -a 'name=group1 state=absent'
192.168.56.88 | CHANGED => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": true,
"name": "group1",
"state": "absent"
}

版权声明:本文为博主原创文章,未经博主允许不得转载。

ansible

举报

相关推荐

0 条评论