Skip to content

Commit

Permalink
fix: 修改下载逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
daixijun committed Jan 4, 2020
1 parent 6ffe399 commit 20dff53
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand All @@ -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 }}"
Expand All @@ -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

Expand All @@ -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 }}"
Expand Down

0 comments on commit 20dff53

Please sign in to comment.