Ansible-group模块
AI-摘要
Tianli GPT
AI初始化中...
介绍自己
生成本文简介
推荐相关文章
前往主页
前往tianli博客
本文最后更新于 2024-08-23,文章内容可能已经过时。
一、group模块
group模块用于管理用户组和用户组属性。
https://docs.ansible.com/ansible/latest/modules/group_module.html#group-module
| 参数 | 说明 |
| ———————- | ———— |
| name= | 组名 |
| state= persent\|absent | 创建\|删除 |
| system= yes\|no | 是否为系统组 |
| gid | gid |
#组创建
[root@manage01 ~]# ansible -m group group1 -a "name=admin gid=4444 state=present"
192.168.98.203 | CHANGED => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/libexec/platform-python"
},
"changed": true,
"gid": 4444,
"name": "admin",
"state": "present",
"system": false
}
192.168.98.202 | CHANGED => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/libexec/platform-python"
},
"changed": true,
"gid": 4444,
"name": "admin",
"state": "present",
"system": false
}
192.168.98.201 | CHANGED => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/libexec/platform-python"
},
"changed": true,
"gid": 4444,
"name": "admin",
"state": "present",
"system": false
}
#删除组
[root@manage01 ~]# ansible -m group group1 -a "name=admin state=absent"
192.168.98.203 | CHANGED => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/libexec/platform-python"
},
"changed": true,
"name": "admin",
"state": "absent"
}
192.168.98.201 | CHANGED => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/libexec/platform-python"
},
"changed": true,
"name": "admin",
"state": "absent"
}
192.168.98.202 | CHANGED => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/libexec/platform-python"
},
"changed": true,
"name": "admin",
"state": "absent"
}
二、学习视频
本文是原创文章,采用 CC BY-NC-ND 4.0 协议,完整转载请注明来自 日趣志
评论
匿名评论
隐私政策
你无需删除空行,直接评论以获取最佳展示效果