vim /srv/salt/soft/modules.sls
echo-install: #每个文件管理必须配置不同的名字,缩进必须一致,name:和source:后面的空格必须有! file.managed: - name: /soft/echo-nginx-module-master.zip - source: salt://nginx/files/echo-nginx-module-master.zip - user: root #用户指定可有可无 - group: root - mode: 755 #权限指定可有可无 cmd.run: - name: cd /soft && unzip echo-nginx-module-master.zip - unless: test -d /soft/echo-nginx-module-master lua-install: file.managed: - name: /soft/lua-nginx-module-master.zip - source: salt://nginx/files/lua-nginx-module-master.zip cmd.run: - name: cd /soft && unzip lua-nginx-module-master.zip - unless: test -d /soft/lua-nginx-module-master purge-install: file.managed: - name: /soft/ngx_cache_purge-2.3.tar.gz - source: salt://nginx/files/ngx_cache_purge-2.3.tar.gz cmd.run: - name: cd /soft && tar xvf ngx_cache_purge-2.3.tar.gz - unless: test -d /soft/ngx_cache_purge-2.3 devel-install: file.managed: - name: /soft/ngx_devel_kit-0.3.0rc1.tar.gz - source: salt://nginx/files/ngx_devel_kit-0.3.0rc1.tar.gz cmd.run: - name: cd /soft && tar xvf ngx_devel_kit-0.3.0rc1.tar.gz - unless: test -d /soft/ngx_devel_kit-0.3.0rc16.执行同步推送
salt 'test' state.highstate
观察是否全部为success,如果有fail,查看具体失败原因,解决问题后可继续推送。
CentOS 6.8 安装LNMP环境(Linux+Nginx+MySQL+PHP)
Linux下安装PHP环境并配置Nginx支持php-fpm模块
Ubuntu 16.04上启用加密安全的Nginx Web服务器
Nginx会话保持之nginx-sticky-module模块