saltstack 远程安装配置httpd,keepalive,nginx
来源:互联网 发布:centos下载教程 编辑:程序博客网 时间:2024/06/05 04:43
//安装:httpd
apache-install:
pkg.installed:
- pkgs:
- httpd
- php
/etc/httpd/conf/httpd.conf:
file.managed:
- source: salt://httpd/files/httpd.conf
- template: jinja
- context:
ip: {{grains['ipv4'][0]}}
prot: 80
apache-service:
service.running:
- name: httpd
- enable: true
- watch:
- file: /etc/httpd/conf/httpd.conf
- require:
- pkg: apache-install
//安装:keepalived
include:
- pkg.install
/mnt/keepalived-1.3.5.tar.gz:
file.managed:
- source: salt://keepalived/files/keepalived-1.3.5.tar.gz
keepalived-install:
cmd.run:
- name: cd /mnt && tar zxf keepalived-1.3.5.tar.gz && cd keepalived-1.3.5 &&./configure --prefix=/usr/local/keepalived/ --disable-fwmark --with-init=SYSV && make && make install
- creates: /usr/local/keepalived/
- require:
- file: /mnt/keepalived-1.3.5.tar.gz
- pkg: make
/etc/keepalived:
file.directory:
- mode: 755
/sbin/keepalived:
file.symlink:
- target: /usr/local/keepalived/sbin/keepalived
/etc/init.d/keepalived:
file.managed:
- source: salt://keepalived/files/keepalived.init
- mode: 755
/etc/sysconfig/keepalived:
file.managed:
- source: salt://keepalived/files/keepalived.sys
//安装Nginx
include:
- pkg.install
nginx:
group.present:
- gid: 888
nginx-user:
user.present:
- name: nginx
- shell: /sbin/nologin
- uid: 888
- gid: 888
- home: /usr/local/nginx
- createhome: False
nginx-source:
file.managed:
- name: /mnt/nginx-1.12.0.tar.gz
- source: salt://nginx/files/nginx-1.12.0.tar.gz
- user: nginx
- group: nginx
- mode: 666
nginx-install:
cmd.run:
- name: cd /mnt && tar zxf nginx-1.12.0.tar.gz && cd nginx-1.12.0 && sed -i.bak 's/CFLAGS="$CFLAGS -g"/#CFLAGS="$CFLAGS -g"/g' auto/cc/gcc && ./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_stub_status_module --with-http_ssl_module && make && make install
- creates: /usr/local/nginx
- require:
- user: nginx-user
- pkg: make
- file: nginx-source
nginx-config:
file.managed:
- name: /usr/local/nginx/conf/nginx.conf
- source: salt://nginx/files/nginx.conf
/etc/init.d/nginx:
file.managed:
- source: salt://nginx/files/nginx
nginx-service:
service.running:
- name: nginx
- enable: True
- reload: True
- require:
- cmd: nginx-install
- file: /etc/init.d/nginx
- watch:
- file: nginx-config
Pkg 文件:
make:
pkg.installed:
- pkg:
- gcc
- openssl-devel
- pcre-devel
- saltstack 远程安装配置httpd,keepalive,nginx
- Nginx Upstream Keepalive配置
- Nginx Upstream Keepalive配置
- Nginx Upstream Keepalive配置
- saltstack--批量安装nginx
- 安装和配置saltstack
- saltstack的安装配置
- saltstack安装配置笔记
- saltstack安装配置
- SaltStack安装及配置
- Saltstack 安装配置详解
- Saltstack 安装配置详解
- keepalive安装配置
- keepalive安装和配置
- Keepalive入门之httpd主备配置测试
- SaltStack 简介、安装、简单配置
- CentOS 6.5 SaltStack安装配置
- [App] Saltstack 安装配置详解
- RCNN学习笔记(2):Rich feature hierarchies for accurate object detection and semantic segmentation
- 记录Hibernate的hql操作
- jquery控制文本框<select>大全
- Activity与Fragment之间的传值
- netstat命令详解
- saltstack 远程安装配置httpd,keepalive,nginx
- Android系统广播大全
- CSS 内联元素和块级元素内部布局规则
- android 系统常用广播
- 使用Intellij IDEA、Maven、Tomcat、MySQL搭建SSH框架
- 安卓、苹果手机数据转移时的备份以及恢复
- mysql存储函数,游标的使用过程中异常捕捉机制
- 2017.07.11——学习总结
- liunx解压文件