From 064b563c29ca6825ac31173392d992a5c0aa16a1 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Mon, 1 Aug 2016 14:19:36 +0200 Subject: [PATCH] library/roles/php-fpm: Support the Ubuntu PPA that permits to install newer php versions. library/roles/drupal-org: 8.1.7 is the newest drupal version and the new default. --- drupal-org/defaults/main.yml | 2 +- drupal-org/tasks/main.yml | 4 ++-- php-fpm/defaults/main.yml | 5 ++++- php-fpm/tasks/main.yml | 12 +++++++++++- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/drupal-org/defaults/main.yml b/drupal-org/defaults/main.yml index 5ef09344..a60cf504 100644 --- a/drupal-org/defaults/main.yml +++ b/drupal-org/defaults/main.yml @@ -1,7 +1,7 @@ --- drupal_install_deb: False drupal_major: 8 -drupal_version: '{{ drupal_major_ver }}.0.3' +drupal_version: '{{ drupal_major_ver }}.1.7' drupal_dist_name: 'drupal-{{ drupal_version }}' drupal_dist_file: '{{ drupal_dist_name }}.tar.gz' drupal_tar_url: 'http://ftp.drupal.org/files/projects/{{ drupal_dist_file }}' diff --git a/drupal-org/tasks/main.yml b/drupal-org/tasks/main.yml index af186a10..a97c27a2 100644 --- a/drupal-org/tasks/main.yml +++ b/drupal-org/tasks/main.yml @@ -1,6 +1,6 @@ --- - name: Install the drupal php prerequisites - apt: name={{ item }} state=present + apt: name={{ item }} state=latest update_cache=yes cache_valid_time=3600 with_items: drupal_php_prereq tags: drupal @@ -69,7 +69,7 @@ tags: drupal - name: Remove the original drupal unpacked distribution - command: rm -fr {{ drupal_download_dir }}/{{ drupal_dist_name }} + file: dest={{ drupal_download_dir }}/{{ drupal_dist_name }} state=absent when: ( unpack_drupal | changed ) tags: drupal diff --git a/php-fpm/defaults/main.yml b/php-fpm/defaults/main.yml index 095daecb..74e6640b 100644 --- a/php-fpm/defaults/main.yml +++ b/php-fpm/defaults/main.yml @@ -5,10 +5,13 @@ # phpfpm_service_enabled: True phpfpm_remove_php_module: True +php_from_ppa: False +php_ppa: ppa:ondrej/php +php_version: 5 phpfpm_base_dir: /etc/php5/fpm php_fpm_packages: - - php5-fpm + - 'php{{ php_version }}-fpm' # Main confign file settings # It can be 'syslog' diff --git a/php-fpm/tasks/main.yml b/php-fpm/tasks/main.yml index c5abeae7..7fe7f4ad 100644 --- a/php-fpm/tasks/main.yml +++ b/php-fpm/tasks/main.yml @@ -1,7 +1,17 @@ --- # php as a standalone service +- name: Install the Ubuntu PHP PPA + apt_repository: repo={{ php_ppa }} state=present update_cache=yes + when: php_from_ppa + tags: [ 'php', 'php_ppa' ] + +- name: Remove the Ubuntu PHP PPA + apt_repository: repo={{ php_ppa }} state=absent update_cache=yes + when: not php_from_ppa + tags: [ 'php', 'php_ppa' ] + - name: Install the php-fpm package - apt: pkg={{ item }} state=present + apt: pkg={{ item }} state=present update_cache=yes cache_valid_time=3600 with_items: '{{ php_fpm_packages }}' tags: php