From 20dff538b6137418a2ae71a93db8883b8a2323eb Mon Sep 17 00:00:00 2001 From: Xijun Dai Date: Sun, 5 Jan 2020 03:36:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tasks/main.yml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 24ce3d5..b23e8c5 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -45,16 +45,26 @@ path: /usr/local/libzip register: libzip_install_stat + - name: Download libzip package + get_url: + url: "{{ php_libzip_download_url }}" + dest: "{{ role_path }}/files/" + become: false + run_once: true + delegate_to: localhost + register: _php_libzip_package + when: + - not libzip_install_stat.stat.exists + - name: Unarchive libzip unarchive: - src: "{{ php_libzip_download_url }}" + src: "files/{{ php_libzip_download_url | basename }}" dest: /usr/local/src creates: /usr/local/src/libzip-{{ php_libzip_version }} - remote_src: true + remote_src: false register: libzip_unarchive when: - - php_force_install|bool or not php_installed_stat.stat.exists - - not libzip_install_stat.stat.exists + - not libzip_install_stat.stat.exists and _php_libzip_package is not skipped - name: Install libzip shell: "{{ item }}" @@ -69,14 +79,6 @@ tags: - skip_ansible_lint - - name: Check php package is already exists - stat: - path: "{{ role_path }}/files/{{ php_download_url | basename }}" - become: false - run_once: true - delegate_to: localhost - register: _php_package_stat - - name: Download php package get_url: url: "{{ php_download_url }}" @@ -85,7 +87,6 @@ run_once: true delegate_to: localhost when: - - not _php_package_stat.stat.exists - not php_installed_stat.stat.exists register: _php_package @@ -97,7 +98,7 @@ remote_src: false register: php_unarchive when: - - php_force_install|bool or _php_package is not skipped or (_php_package_stat.stat.exists and not php_installed_stat.stat.exists) + - _php_package is not skipped and not php_installed_stat.stat.exists - name: Compile and Install shell: "{{ php_build_parameters }}"