SaltStack 模块
pkg.init: pkg.installed:- names:
- lrzsz
- mtr
- nmap
- gcc
- bison
- bison-devel
- zlib-devel
- libmcrypt-devel
- mcrypt
- mhash-devel
- openssl-devel
- libxml2-devel
- libcurl-devel
- bzip2-devel
- readline-devel
- libedit-devel
include:
- init.pkg
www-user-group:
group.present:
- name: www
- gid: 1000
user.present:
- name: www
- fullname: www
- shell: /sbin/nologin
- uid: 1000
- gid: 1000
php-install:
file.managed:
- name: /usr/local/src/php-5.5.38.tar.gz
- source: salt://php/files/php-5.5.38.tar.gz
- user: root
- group: root
- mode: 644
cmd.run:
- name: cd /usr/local/src && tar zxf php-5.5.38.tar.gz && cd php-5.5.38 && ./configure --prefix=/usr/local/php --with-config-file-path=/etc --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-opcache --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-gettext --enable-mbstring --with-iconv --with-mcrypt --with-mhash --with-openssl --enable-bcmath --enable-soap --with-libxml-dir --enable-pcntl --enable-shmop --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-sockets --with-curl --with-zlib --enable-zip --with-bz2 --with-readline --without-sqlite3 --without-pdo-sqlite --with-pear && make && make install
- unless: test -d /usr/local/php
php-set:
cmd.run:
- name: cp -rf /usr/local/src/php-5.5.38/php.ini-development /etc/php.ini && cp -rf /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf && cp -rf /usr/local/src/php-5.5.38/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm && chmod +x /etc/init.d/php-fpm && echo'/etc/init.d/php-fpm start' >> /etc/rc.local && ln -fs /usr/local/php/sbin/php-fpm /sbin && ln -fs /usr/local/php/bin/* /bin/ && /etc/init.d/php-fpm start
##遇到错误最好把命令拆分执行,以便排错
页:
[1]