查看“Saltstack state安装nignx”的源代码
←
Saltstack state安装nignx
跳到导航
跳到搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
=ins= ip 192.168.88.60 ubuntu18.04 前提 已安装好 master minion <pre> 创建目录 mkdir -p /srv/salt/prod/pcre/files/ mkdir -p /srv/salt/prod/nginx/files/ 下载pcre和nginx源码包保存到各自的files目录下 root@myxps:/srv/salt/prod# ls nginx/files/ nginx-1.20.1.tar.gz openssl-1.1.1k.tar.gz wget https://ftp.pcre.org/pub/pcre/pcre-8.42.tar.bz2 root@myxps:/srv/salt/prod# ls pcre/files/ pcre-8.42.tar.bz2 </pre> == 编写pcre安装文件== <pre> vi /srv/salt/prod/pcre/install.sls pcre-source-install: file.managed: - name: /usr/local/src/pcre-8.42.tar.bz2 - source: salt://pcre/files/pcre-8.42.tar.bz2 - user: root - group: root - mode: 755 cmd.run: - name: cd /usr/local/src && tar xvf pcre-8.42.tar.bz2 && cd pcre-8.42 && ./configure --prefix=/usr/local/pcre && make && make install - unless: test -d /usr/local/pcre - require: - file: pcre-source-install </pre> == 编写nginx安装文件== <pre> vi /srv/salt/prod/pcre/install.sls pcre-source-install: file.managed: - name: /usr/local/src/pcre-8.42.tar.bz2 - source: salt://pcre/files/pcre-8.42.tar.bz2 - user: root - group: root - mode: 755 cmd.run: - name: cd /usr/local/src && tar xvf pcre-8.42.tar.bz2 && cd pcre-8.42 && ./configure --prefix=/usr/local/pcre && make && make install - unless: test -d /usr/local/pcre - require: - file: pcre-source-install root@myxps:/srv/salt/prod# cat /srv/salt/prod/nginx/install.sls include: - pcre.install - user.www nginx-source-install: file.managed: - name: /usr/local/src/nginx-1.20.1.tar.gz - source: salt://nginx/files/nginx-1.20.1.tar.gz - user: root - group: root - mode: 755 cmd.run: - name: cd /usr/local/src && tar xvf nginx-1.20.1.tar.gz && cd nginx-1.20.1 && ./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_stub_status_module --with-file-aio --with-http_dav_module --with-pcre=/usr/local/src/pcre-8.42 --without-http_gzip_module && make && make install && chown -R www:www /usr/local/nginx - unless: test -d /usr/local/nginx - require: - user: www-user-group - file: nginx-source-install - cmd: pcre-source-install </pre> == == <pre> </pre> =see also= [https://www.jianshu.com/p/9cacd70ff53a 用saltstack安装nignx服务器] https://github.com/tjkt/saltstack-nginx/tree/master/salt [https://www.cnblogs.com/reblue520/p/6732942.html saltstack自动化运维系列⑧SaltStack实践配置管理安装nginx-1.10.3 ] [http://www.showerlee.com/archives/1538 [Saltstack<nowiki>]</nowiki> CentOS下批量部署Nginx] [[category:ops]] [[category:saltstack]]
返回至
Saltstack state安装nignx
。
导航菜单
个人工具
登录
名字空间
页面
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
导航
首页
我的导航
关于我
shell
python
ops
linuxchina.net
blog.linuxchina
最近更改
随机页面
帮助
工具
链入页面
相关更改
特殊页面
页面信息