Skip to content

Instantly share code, notes, and snippets.

@kmadac
Created May 6, 2016 14:04
Show Gist options
  • Save kmadac/597f35a6fc8fa882d8ba8b2da8757254 to your computer and use it in GitHub Desktop.
Save kmadac/597f35a6fc8fa882d8ba8b2da8757254 to your computer and use it in GitHub Desktop.
configoptions="
--enable-cli \
--enable-debug \
--enable-bcmath \
--enable-calendar \
--enable-exif \
--enable-ftp \
--enable-mbstring \
--enable-pcntl \
--enable-soap \
--enable-sockets \
--enable-sqlite-utf8 \
--enable-wddx \
--enable-zip \
--enable-readline \
--enable-posix \
--with-readline \
--with-posix
--with-apache2 \
--with-openssl \
--with-zlib \
--with-gettext \
--with-pear \
--with-curl \
--with-gd \
--with-mcrypt \
--with-pdo-mysql \
--enable-mbstring \
--enable-fpm \
"
---
- hosts: localhost
remote_user: root
vars:
- php_farm_path: /opt/phpfarm
- php_versions:
- 5.6.21
- 5.5.35
tasks:
- name: install necessary packages
apt: name={{ item }} state=installed
with_items:
- libxml2
- libxml2-dev
- libssl-dev
- libcurl4-openssl-dev
- pkg-config
- libjpeg-dev
- libpng12-dev
- libmysqlclient-dev
- libreadline6-dev
- name: get php-farm code
git: repo=https://github.com/cweiske/phpfarm.git dest={{ php_farm_path }} update=no
- name: ensure that php custom options are specified
copy: src=custom-options.sh dest={{ php_farm_path }}/src/custom-options.sh owner=root group=root mode=644
notify: recompile php
- name: find php version installation status
stat: path="{{ php_farm_path }}/inst/php-{{ item }}"
with_items: "{{ php_versions }}"
register: php_status
tags: debug
- name: compile non-existent php
shell: "{{ php_farm_path }}/src/compile.sh {{ item.item }}"
when: item.stat.exists != True
with_items: "{{ php_status.results }}"
tags: debug
handlers:
- name: recompile php
shell: "{{ php_farm_path }}/src/compile.sh {{ item }}"
with_items: "{{ php_versions }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment