Created
October 17, 2013 10:58
-
-
Save myaaaaa-chan/7022957 to your computer and use it in GitHub Desktop.
ansibleでPHPをインストールするPlaybookメモ ref: http://qiita.com/nyan_mofmof/items/4b7c07bd034d925c1bd2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - hosts: [web-server] | |
| vars: | |
| src_dir: "/usr/local/src" | |
| php_src_dir: "$src_dir/php" | |
| php_version: "5.5.4" | |
| php_src_url: "http://jp1.php.net/distributions/php-$php_version.tar.gz" | |
| tasks: | |
| - name: "remove installed package" | |
| yum: name=php state=absent | |
| - name: "install depended package" | |
| yum: name=$item | |
| with_items: | |
| - perl | |
| - gd-devel | |
| - libjpeg-devel | |
| - libpng-devel | |
| - libxml2 | |
| - libxml2-devel | |
| - openssl | |
| - openssl-devel | |
| - name: "make src dir" | |
| file: dest=$php_src_dir state=directory | |
| - name: "download php src" | |
| get_url: url=$php_src_url dest=$php_src_dir | |
| - name: "extract src file" | |
| command: tar zxvf php-$php_version.tar.gz chdir=$php_src_dir | |
| - name: "create mysql synbolic link" | |
| file: src=/usr/lib64/mysql dest=/usr/lib/mysql state=link | |
| - name: "configure" | |
| command: chdir=$php_src_dir/php-$php_version env ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --enable-mbstring --enable-mbregex --disable-cgi --enable-cli --with-zlib --with-gd --with-jpeg-dir=/usr/local/src/php/php-$php_version/ext/gd/libgd --with-png-dir=/usr/local/src/php/php-$php_version/ext/gd/libgd --with-openssl --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd | |
| - name: "make" | |
| command: make chdir=$php_src_dir/php-$php_version | |
| - name: "install" | |
| command: make install chdir=$php_src_dir/php-$php_version | |
| - name: "copy initial php.ini" | |
| copy: src=$php_src_dir/php-$php_version/php.ini-production dest=/usr/local/lib/php.ini | |
| - name: "set mime type to httpd conf" | |
| command: echo 'application/x-httpd-php php html' >> /usr/local/apache2/conf/mime.types |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment