library/roles/php-fpm: Some changes needed to make the PPA working.

library/roles/drupal-org: Add some modules.
This commit is contained in:
Andrea Dell'Amico 2016-08-01 17:22:51 +02:00
parent f79346cf95
commit e3f897d903
5 changed files with 28 additions and 20 deletions

View File

@ -9,11 +9,16 @@ drupal_download_dir: /srv/drupal
drupal_install_dir: /var/www
drupal_php_prereq:
- php5-json
- php5-intl
- php5-cli
- php5-mysqlnd
- php5-gd
- 'php{{ php_version }}-json'
- 'php{{ php_version }}-intl'
- 'php{{ php_version }}-cli'
- 'php{{ php_version }}-mysqlnd'
- 'php{{ php_version }}-gd'
- 'php{{ php_version }}-xml'
- 'php{{ php_version }}-json'
- 'php{{ php_version }}-curl'
- 'php{{ php_version }}-mbstring'
- php-ssh2
- php-apc
- php-pear
- php-date

View File

@ -1,7 +1,7 @@
---
- name: Install the drupal php prerequisites
apt: name={{ item }} state=latest update_cache=yes cache_valid_time=3600
with_items: drupal_php_prereq
with_items: '{{ drupal_php_prereq }}'
tags: drupal
- name: Ensure that the download and install dirs exist
@ -31,26 +31,26 @@
command: cp -a {{ drupal_download_dir }}/{{ drupal_dist_name }} {{ drupal_install_dir }}/{{ item.virthost }}
args:
creates: '{{ drupal_install_dir }}/{{ item.virthost }}/index.php'
with_items: phpfpm_pools
with_items: '{{ phpfpm_pools }}'
when: ( drupal_download | changed )
register: unpack_drupal
tags: drupal
- name: Create the default settings file
command: cp {{ drupal_install_dir }}/{{ item.virthost }}/sites/default/default.settings.php {{ drupal_install_dir }}/{{ item.virthost }}sites/default/settings.php
command: cp {{ drupal_install_dir }}/{{ item.virthost }}/sites/default/default.settings.php {{ drupal_install_dir }}/{{ item.virthost }}/sites/default/settings.php
args:
creates: '{{ drupal_install_dir }}/{{ item.virthost }}/sites/default/settings.php'
with_items: phpfpm_pools
with_items: '{{ phpfpm_pools }}'
when:
- ( unpack_drupal | changed )
- '{{ drupal_major_ver }} >= 8'
tags: drupal
- name: Create the default services file
command: cp {{ drupal_install_dir }}/{{ item.virthost }}/sites/default/default.services.yml {{ drupal_install_dir }}/{{ item.virthost }}sites/default/services.yml
command: cp {{ drupal_install_dir }}/{{ item.virthost }}/sites/default/default.services.yml {{ drupal_install_dir }}/{{ item.virthost }}/sites/default/services.yml
args:
creates: '{{ drupal_install_dir }}/{{ item.virthost }}/sites/default/services.yml'
with_items: phpfpm_pools
with_items: '{{ phpfpm_pools }}'
when:
- ( unpack_drupal | changed )
- '{{ drupal_major_ver }} >= 8'
@ -58,13 +58,13 @@
- name: Create the files directory
file: dest={{ drupal_install_dir }}/{{ item.virthost }}/sites/default/files owner={{ item.user }} group={{ item.group }} mode=0770 state=directory
with_items: phpfpm_pools
with_items: '{{ phpfpm_pools }}'
when: ( unpack_drupal | changed )
tags: drupal
- name: Set the correct ownership of the drupal files
file: dest={{ drupal_install_dir }}/{{ item.virthost }} owner={{ item.user }} group={{ item.group }} recurse=yes state=directory
with_items: phpfpm_pools
with_items: '{{ phpfpm_pools }}'
when: ( unpack_drupal | changed )
tags: drupal

View File

@ -9,14 +9,17 @@ php_from_ppa: False
php_ppa: ppa:ondrej/php
php_version: 5
phpfpm_base_dir: /etc/php5/fpm
phpfpm_base_dir: '/etc/php{{ php_version }}/fpm'
# Change to when using the PPA
# phpfpm_base_dir: '/etc/php/{{ php_version }}/fpm'
php_fpm_packages:
- 'php{{ php_version }}-fpm'
# Main confign file settings
# It can be 'syslog'
phpfpm_logdir: /var/log/php-fpm
phpfpm_error_logfile: /var/log/php5-fpm.log
phpfpm_error_logfile: '/var/log/php{{ php_version }}-fpm.log'
phpfpm_syslog_facility: daemon
phpfpm_syslog_ident: php-fpm
phpfpm_log_level: notice
@ -58,7 +61,7 @@ phpfpm_default_rlimit_files: "1024"
phpfpm_default_extensions: ".php"
phpfpm_default_context: '/'
phpfpm_default_session_handler: 'files'
phpfpm_default_session_prefix: '/var/lib/php5'
phpfpm_default_session_prefix: '/var/lib/php'
phpfpm_session_prefix: '{{ phpfpm_default_session_prefix }}'
phpfpm_default_define_custom_variables: False

View File

@ -1,8 +1,8 @@
---
- name: Reload php-fpm
service: name=php5-fpm state=reloaded
service: name=php{{ php_version }}-fpm state=reloaded
when: phpfpm_service_enabled
- name: Restart php-fpm
service: name=php5-fpm state=restarted
service: name=php{{ php_version }}-fpm state=restarted
when: phpfpm_service_enabled

View File

@ -68,12 +68,12 @@
tags: [ 'php', 'fpm_conf', 'fpm_pool', 'fpm_pool_conf' ]
- name: Ensure that the php-fpm service is started and enabled
service: name=php5-fpm state=started enabled=yes
service: name=php{{ php_version }}-fpm state=started enabled=yes
when: phpfpm_service_enabled
tags: php
- name: Ensure that the php-fpm service is stopped and disabled
service: name=php5-fpm state=stopped enabled=no
service: name=php{{ php_version }}-fpm state=stopped enabled=no
when: not phpfpm_service_enabled
tags: php