标签:present code gid srv tables pre mysq 判断 stack
一、用户和用户组模块
说明:该sls文件用来在Minion端创建nginx用户和nginx用户组,当创建nginx用户时,对nginx用户组是否已存在做判断!
(1) /srv/salt/create_user/nginx_user.sls
nginx_user: user.present: - name: nginx - uid: 121 - gid: 121 - createhome: true - shell: /bin/bash - require: - group: nginx group.present: - name: nginx - gid: 121
(2) /srv/tops
说明:将nginx_user.sls所在的目录在top.sls文件进行引用
/srv/top.sls
base: ‘*‘: - cpitables.* - install_zabbix.* - install_mysql.* - create_user.*
(3) 调用sls文件创建用户和用户
salt ‘*‘ state.sls create_user.nginx_user
二、服务模块
标签:present code gid srv tables pre mysq 判断 stack
原文地址:http://www.cnblogs.com/xialiaoliao0911/p/7606128.html