Skip to content

Commit

Permalink
Merge pull request #2 from itcraftsmanpl/update-ppa
Browse files Browse the repository at this point in the history
Update ppa and add more variables
  • Loading branch information
akondas committed Apr 16, 2016
2 parents 0397e70 + 8add92c commit 4a7e85d
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 10 deletions.
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

An Ansible role that installs and configure PHP 7 on Debian/Ubuntu servers.

Current PHP7 version: **7.0.0RC8**
Current PHP7 version: **7.0.5**

## Requirements

Expand All @@ -12,7 +12,7 @@ None.

Available variables are listed below, along with default values (see `defaults/main.yml`):

php_ppa: "ppa:ondrej/php-7.0"
php_ppa: "ppa:ondrej/php"
php_packages:
- php7.0-common
- php7.0-cli
Expand All @@ -22,9 +22,21 @@ Available variables are listed below, along with default values (see `defaults/m
- php7.0-fpm
- php7.0-mysql
- php7.0-gd
- php7.0-mbstring
- php7.0-mcrypt
php_timezone: Europe/Warsaw
php_upload_max_filesize: "20M"
php_post_max_size: "20M"
php_memory_limit: "1024M"
php_max_execution_time: 60

php_opcache_enable: 1
php_opcache_revalidate_freq: 2592000
php_opcache_opcache_validate_timestamps: 1
php_opcache_max_accelerated_files: 20000
php_opcache_memory_consumption: 192
php_opcache_interned_strings_buffer: 16
php_opcache_fast_shutdown: 1

## Dependencies

Expand All @@ -38,4 +50,4 @@ None.

## License

MIT
MIT
15 changes: 13 additions & 2 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
php_ppa: "ppa:ondrej/php-7.0"
php_ppa: "ppa:ondrej/php"
php_packages:
- php7.0-common
- php7.0-cli
Expand All @@ -9,7 +9,18 @@ php_packages:
- php7.0-fpm
- php7.0-mysql
- php7.0-gd
- php7.0-mbstring
- php7.0-mcrypt
php_timezone: Europe/Warsaw
php_upload_max_filesize: "20M"
php_post_max_size: "20M"
php_memory_limit: "1024M"
php_memory_limit: "1024M"
php_max_execution_time: 60

php_opcache_enable: 1
php_opcache_revalidate_freq: 2592000
php_opcache_opcache_validate_timestamps: 1
php_opcache_max_accelerated_files: 20000
php_opcache_memory_consumption: 192
php_opcache_interned_strings_buffer: 16
php_opcache_fast_shutdown: 1
2 changes: 1 addition & 1 deletion tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
when: phpfpm.stat.exists

- include: php-cli.yml
when: phpcli.stat.exists
when: phpcli.stat.exists
6 changes: 3 additions & 3 deletions tasks/php-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
regexp='date.timezone ='
line='date.timezone = {{ php_timezone }}'

- name: Enabling opcache cli
- name: disabling opcache cli
lineinfile: dest=/etc/php/7.0/cli/php.ini
regexp=';?opcache.enable_cli='
line='opcache.enable_cli=1'
regexp='opcache.enable_cli='
line='opcache.enable_cli=0'
57 changes: 56 additions & 1 deletion tasks/php-fpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,59 @@
lineinfile: dest=/etc/php/7.0/fpm/php.ini
regexp='memory_limit(\s)?='
line='memory_limit = {{ php_memory_limit }}'
notify: restart php7-fpm
notify: restart php7-fpm

- name: Set max_execution_time
lineinfile: dest=/etc/php/7.0/fpm/php.ini
regexp='max_execution_time(\s)?='
line='max_execution_time = {{ php_max_execution_time }}'
notify: restart php7-fpm

- name: enabling opcache
lineinfile: dest=/etc/php/7.0/fpm/php.ini
regexp='opcache.enable='
line='opcache.enable={{ php_opcache_enable }}'
insertafter="^[opcache]"
notify: restart php7-fpm

- name: opcache - changing revalidate frequency
lineinfile: dest=/etc/php/7.0/fpm/php.ini
regexp='opcache.revalidate_freq='
line='opcache.revalidate_freq={{ php_opcache_revalidate_freq }}'
insertafter="^[opcache]"
notify: restart php7-fpm

- name: opcache - changing validate timestamps
lineinfile: dest=/etc/php/7.0/fpm/php.ini
regexp='opcache.validate_timestamps='
line='opcache.validate_timestamps={{ php_opcache_opcache_validate_timestamps }}'
insertafter="^[opcache]"
notify: restart php7-fpm

- name: opcache - changing max accelerated files
lineinfile: dest=/etc/php/7.0/fpm/php.ini
regexp='opcache.max_accelerated_files='
line='opcache.validate_timestamps={{ php_opcache_max_accelerated_files }}'
insertafter="^[opcache]"
notify: restart php7-fpm

- name: opcache - memory consumption
lineinfile: dest=/etc/php/7.0/fpm/php.ini
regexp='opcache.memory_consumption='
line='opcache.memory_consumption={{ php_opcache_memory_consumption }}'
insertafter="^[opcache]"
notify: restart php7-fpm

- name: opcache - interned strings buffer
lineinfile: dest=/etc/php/7.0/fpm/php.ini
regexp='opcache.interned_strings_buffer='
line='opcache.interned_strings_buffer={{ php_opcache_interned_strings_buffer }}'
insertafter="^[opcache]"
notify: restart php7-fpm

- name: opcache - fast shutdown
lineinfile: dest=/etc/php/7.0/fpm/php.ini
regexp='opcache.fast_shutdown='
line='opcache.fast_shutdown={{ php_opcache_fast_shutdown }}'
insertafter="^[opcache]"
notify: restart php7-fpm

0 comments on commit 4a7e85d

Please sign in to comment.