diff --git a/handlers/main.yml b/handlers/main.yml index 4420947ec1905ec3edde397fb48b932f0117fd8a..18221b19a1ac0095dd7250d85492cc9ebf681d1f 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -3,5 +3,5 @@ - name: "Restart PHP-FPM" service: - name: '{{ phpFpmService|default("php7.0-fpm") }}' + name: '{{ phpFpmService }}' state: 'restarted' diff --git a/tasks/main.yml b/tasks/main.yml index b38c0209422031e9586ceda98bdf603e73adf1be..85605cdc112c9b136beea30504d4e87d3c78d355 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -11,6 +11,9 @@ - block: + - include_tasks: 'variables.yml' + tags: 'always' + - import_tasks: php.yml - name: "Link PhpEnMod for PHP 5.3" diff --git a/tasks/oci-7.1.yml b/tasks/oci-7.1.yml new file mode 100644 index 0000000000000000000000000000000000000000..2f751852998240c81ef0997516bf23770259d08b --- /dev/null +++ b/tasks/oci-7.1.yml @@ -0,0 +1,4 @@ +--- +# file: roles/php/tasks/oci-7.1.yml + +- debug: msg="OCI8 for PHP 7.1 not implemented yet" diff --git a/tasks/php.yml b/tasks/php.yml index fc851af203ff38c491e5772dcf4bb9bc54b89435..bfccb5c6973db2d69fbfecfde36b5fe30af4ee58 100644 --- a/tasks/php.yml +++ b/tasks/php.yml @@ -26,8 +26,9 @@ when: php_version_main|default('7') != '7' ignore_errors: true +# NOTE: If oauth is already installed and we install a new PHP 7 version then this fails and we need --force as well - name: "PHP | Install PECL packages" - shell: 'pecl install --soft oauth' + shell: 'pecl install --soft --force oauth' when: php_version_main|default('7') == '7' ignore_errors: true @@ -158,7 +159,7 @@ - block: - set_fact: - phpLogRotatePrefix='7.0' + phpLogRotatePrefix='{{php_version|default("7.0")}}' phpLibPrefix='' when: php_version_main|default('7') == '7' - set_fact: diff --git a/tasks/variables.yml b/tasks/variables.yml new file mode 100644 index 0000000000000000000000000000000000000000..5c8b7800abb8c86ee819a56078827d9fa4ec16b5 --- /dev/null +++ b/tasks/variables.yml @@ -0,0 +1,10 @@ +--- +# file: roles/php/tasks/variables.yml + +- block: + - set_fact: phpFpmService='php5-fpm' + - set_fact: phpFpmService='php-fpm' + when: php_version_main|default('7') == '5' + - set_fact: phpFpmService='php{{php_version|default("7.0")}}-fpm' + when: php_version_main|default('7') == '7' + tags: 'always'