Configuration Management installation Apache
On *server:
Vim/etc/salt/master #搜索找到file_roots
* Open the following comment:
File_roots: #总配置入口路径
Base
-/srv/salt/
Mkdir/srv/salt;cd/srv/salt
*vim/srv/salt/top.sls #加入以下内容, top for the total entrance file, the name is fixed.
Base
‘*‘:
-Apache
* means that the Apache module is executed on all clients.
* Restart/etc/init.d/salt-master Restart
*vim/srv/salt/apache.sls #加入以下内容, this is the contents of the Apache module
Apache-service: #只是一个名字
Pkg.installed: #pkg是模块名, followed by a function
-Names: If there is only one service, then you can write it-name:httpd don't have to change a line.
-HTTPd #安装包
-Httpd-devel #安装包
Service.running:
-NAME:HTTPD
-Enable:true
Description: Apache-service is the name of the ID, customized. Pkg.installed is the package installation function, and the following is the name of the package to install. Service.running is also a function to ensure that the specified service starts, and enable indicates boot.
Execute command: Salt ' client.wyp.com ' state.highstate
You can see the client installation, start up and boot up.
2.5-saltstack Configuring Apache