From dbcf6994d1c7db23d86bda383a309101cc386181 Mon Sep 17 00:00:00 2001 From: Thom Toogood Date: Wed, 15 Jun 2016 15:21:50 +1000 Subject: [PATCH] Added role for PHP 7 specific config. --- .../ansible/config/beetbox.config.yml | 2 +- .../roles/beetbox-common/meta/main.yml | 1 + .../roles/beetbox-php-7.0/tasks/main.yml | 15 +++++++ .../roles/beetbox-php-ppa/tasks/main.yml | 43 ++----------------- 4 files changed, 20 insertions(+), 41 deletions(-) create mode 100644 provisioning/ansible/roles/beetbox-php-7.0/tasks/main.yml diff --git a/provisioning/ansible/config/beetbox.config.yml b/provisioning/ansible/config/beetbox.config.yml index 465ce3f..8fe8e29 100644 --- a/provisioning/ansible/config/beetbox.config.yml +++ b/provisioning/ansible/config/beetbox.config.yml @@ -270,7 +270,7 @@ php_extension_conf_paths: - "/etc/php/{{ php_version }}/fpm/conf.d" - "/etc/php/{{ php_version }}/apache2/conf.d" - "/etc/php/{{ php_version }}/cli/conf.d" -php_fpm_daemon: "php{{ php_version }}-fpm" +php_fpm_daemon: "php5.6-fpm" php_fpm_conf_path: "/etc/php/{{ php_version }}/fpm" php_mysql_package: "php{{ php_version }}-mysql" php_memcached_package: "php-memcache" diff --git a/provisioning/ansible/roles/beetbox-common/meta/main.yml b/provisioning/ansible/roles/beetbox-common/meta/main.yml index cb69d20..ec5da8e 100644 --- a/provisioning/ansible/roles/beetbox-common/meta/main.yml +++ b/provisioning/ansible/roles/beetbox-common/meta/main.yml @@ -7,6 +7,7 @@ dependencies: - { role: geerlingguy.nginx } - { role: geerlingguy.mysql } - { role: beetbox-php-ppa } + - { role: beetbox-php-7.0, when: "{{ php_version }} == '7.0'" } - { role: geerlingguy.php } - { role: geerlingguy.php-pecl } - { role: geerlingguy.php-mysql } diff --git a/provisioning/ansible/roles/beetbox-php-7.0/tasks/main.yml b/provisioning/ansible/roles/beetbox-php-7.0/tasks/main.yml new file mode 100644 index 0000000..e4a5ea4 --- /dev/null +++ b/provisioning/ansible/roles/beetbox-php-7.0/tasks/main.yml @@ -0,0 +1,15 @@ +--- +- name: + set_fact: + php_fpm_daemon: php7.0-fpm + when: "{{ php_fpm_daemon }} == 'php5-fpm'" + +- name: Set xhprof_download_url for PHP7. + set_fact: + xhprof_download_url: https://github.com/RustJason/xhprof/archive/php7.zip + when: "{{ xhprof_download_url }} == 'https://github.com/phacility/xhprof/archive/master.tar.gz'" + +- name: Set xhprof_download_folder_name for PHP7. + set_fact: + xhprof_download_folder_name: xhprof-php7 + when: "{{ xhprof_download_folder_name }} == 'master'" diff --git a/provisioning/ansible/roles/beetbox-php-ppa/tasks/main.yml b/provisioning/ansible/roles/beetbox-php-ppa/tasks/main.yml index 972310c..536b4fb 100644 --- a/provisioning/ansible/roles/beetbox-php-ppa/tasks/main.yml +++ b/provisioning/ansible/roles/beetbox-php-ppa/tasks/main.yml @@ -15,16 +15,6 @@ - "{{ php55_packages }} + {{ php56_packages }} + {{ php70_packages }}" register: php_purge -- name: Purge depreciated memcached package. - apt: - name: "{{ item }}" - state: absent - purge: yes - force: yes - when: php_purge.changed - with_items: - - "php-memcached" - - name: Purge PHP modules directory. file: path: "{{ item }}" @@ -37,41 +27,14 @@ - name: Set PHP 5.5 packages. set_fact: php_packages: "{{ php55_packages }}" - when: php_version == '5.5' + when: "{{ php_version }} == '5.5'" - name: Set PHP 5.6 packages. set_fact: php_packages: "{{ php56_packages }}" - when: php_version == '5.6' + when: "{{ php_version }} == '5.6'" - name: Set PHP 7.0 packages. set_fact: php_packages: "{{ php70_packages }}" - when: php_version == '7.0' - -# PHP 7 Support - -- name: Set default PHP7 mysql package. - set_fact: - php_mysql_package: php7.0-mysql - when: (php_version == '7.0') and (php_mysql_package is not defined) - -- name: Set default PHP7 fpm daemon. - set_fact: - php_fpm_daemon: php7.0-fpm - when: (php_version == '7.0') and (php_fpm_daemon is not defined) - -- name: Set default PHP7 fpm pool conf path. - set_fact: - php_fpm_pool_conf_path: "/etc/php/7.0/fpm/pool.d/www.conf" - when: (php_version == '7.0') and (php_fpm_pool_conf_path is not defined) - -- name: Set xhprof_download_url for PHP7. - set_fact: - xhprof_download_url: https://github.com/RustJason/xhprof/archive/php7.zip - when: php_version == '7.0' - -- name: Set xhprof_download_folder_name for PHP7. - set_fact: - xhprof_download_folder_name: xhprof-php7 - when: php_version == '7.0' + when: "{{ php_version }} == '7.0'"