diff --git a/defaults/main.yml b/defaults/main.yml index 15a03e9..dc3a058 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -25,7 +25,7 @@ php_fpm_pm_max_spare_servers: 5 # The executable to run when calling PHP from the command line. php_executable: "php" -# OpCache settings (useful for PHP >=5.5). +# OpCache settings. php_opcache_zend_extension: "opcache.so" php_opcache_enable: "1" php_opcache_enable_cli: "0" @@ -81,6 +81,7 @@ php_display_startup_errors: "Off" # Install PHP from source (instead of using a package manager) with these vars. php_install_from_source: false +php_source_repo: "https://git.php.net/repository/php-src.git" php_source_version: "master" php_source_clone_dir: "~/php-src" php_source_clone_depth: 1 diff --git a/tasks/install-from-source.yml b/tasks/install-from-source.yml index fdbad6b..c277d3d 100644 --- a/tasks/install-from-source.yml +++ b/tasks/install-from-source.yml @@ -78,31 +78,31 @@ - name: Clone the PHP repository. git: - repo: https://git.php.net/repository/php-src.git + repo: "{{ php_source_repo }}" dest: "{{ php_source_clone_dir }}" version: "{{ php_source_version }}" accept_hostkey: yes depth: "{{ php_source_clone_depth }}" - when: php_installed|failed + when: php_installed.rc != 0 - name: Ensure PHP installation path exists. file: path: "{{ php_source_install_path }}" state: directory mode: 0755 - when: php_installed|failed + when: php_installed.rc != 0 - name: Build configure script. shell: > ./buildconf --force chdir={{ php_source_clone_dir }} - when: php_installed|failed + when: php_installed.rc != 0 - name: Run configure script. shell: > {{ php_source_configure_command }} chdir={{ php_source_clone_dir }} - when: php_installed|failed + when: php_installed.rc != 0 - name: Make and install PHP. shell: > @@ -111,7 +111,7 @@ with_items: - "{{ php_source_make_command }}" - make install - when: php_installed|failed + when: php_installed.rc != 0 - name: Ensure php executable is symlinked into a standard path. file: diff --git a/tests/test-source.yml b/tests/test-source.yml index 5bd5bb1..f364cc0 100644 --- a/tests/test-source.yml +++ b/tests/test-source.yml @@ -5,10 +5,8 @@ php_enable_webserver: false php_install_from_source: true php_source_clone_dir: /root/php-src - # Workaround for https://github.com/ansible/ansible-modules-core/issues/5457 - php_source_clone_depth: 0 php_source_make_command: "make --jobs=2" - php_source_version: "php-7.0.13" + php_source_version: "php-7.1.9" php_memory_limit: "192M" pre_tasks: