Skip to content

Commit

Permalink
Try download mirror and if fail archive mirror
Browse files Browse the repository at this point in the history
  • Loading branch information
eskabetxe committed Apr 28, 2022
1 parent 6da48d7 commit 9ccb696
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 25 deletions.
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,16 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a ch
### Fixed

## [X.Y.Z](https://github.com/idealista/flink_role/tree/X.Y.Z)
### [Full Changelog](https://github.com/idealista/flink_role/compare/1.0.0...X.Y.Z)
### [Full Changelog](https://github.com/idealista/flink_role/compare/1.1.0...X.Y.Z)
### Changed
*[#<issue_number>](https://github.com/idealista/flink_role/issues/<issue_number>) \<Change description\>* @\<author\>
*[#<issue_number>](https://github.com/idealista/flink_role/issues/<issue_number>) \<Change description\>* @\<author\>


## [1.1.0](https://github.com/idealista/flink_role/tree/1.1.0)
### [Full Changelog](https://github.com/idealista/flink_role/compare/1.0.0...1.1.0)
### Changed
- *Bump flink version to 1.15.0* @eskabetxe
- *Speedup downloads if last version of minor is used* @eskabetxe

## [1.0.0](https://github.com/idealista/flink_role/tree/1.0.0)
- *First version* @eskabetxe
5 changes: 3 additions & 2 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ flink_jobs_path: "{{ flink_data_path }}/jobs"
flink_extra_path: []

# Download paths
flink_mirror: "https://archive.apache.org/dist/flink"
flink_mirror: "https://downloads.apache.org/flink"
flink_mirror_archive: "https://archive.apache.org/dist/flink"
flink_package_name: "flink-{{ flink_version }}-bin-scala_{{ flink_scala_version }}"
flink_package: "{{ flink_package_name }}.tgz"
flink_bin_url: "{{ flink_mirror }}/flink-{{ flink_version }}/{{ flink_package }}"
flink_bin_url: "/flink-{{ flink_version }}/{{ flink_package }}"

# Templates path
flink_jobmanger_service_template_path: templates/flink-jobmanager.service.j2
Expand Down
57 changes: 36 additions & 21 deletions tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,41 @@
args:
chdir: "{{ flink_install_path }}/bin"

- name: FLINK | Delete installation older
file:
path: "{{ flink_install_path }}"
state: absent
when: 'flink_force_reinstall or flink_check is failed or flink_check.stdout|length == 0'
- name: FLINK | Install
block:
- name: FLINK | Delete installation older
file:
path: "{{ flink_install_path }}"
state: absent

- name: FLINK | Create install path
file:
path: "{{ flink_install_path }}"
state: directory
owner: "{{ flink_user }}"
group: "{{ flink_group }}"
mode: 0755

- name: FLINK | Untar flink
unarchive:
extra_opts: ['--strip-components=1']
src: "{{ flink_mirror + flink_bin_url }}"
remote_src: true
dest: "{{ flink_install_path }}"
owner: "{{ flink_user }}"
group: "{{ flink_group }}"
register: flink_download
ignore_errors: true

- name: FLINK | Untar flink by archive
unarchive:
extra_opts: ['--strip-components=1']
src: "{{ flink_mirror_archive + flink_bin_url }}"
remote_src: true
dest: "{{ flink_install_path }}"
owner: "{{ flink_user }}"
group: "{{ flink_group }}"
when: 'flink_download is failed'

- name: FLINK | Create install path
file:
path: "{{ flink_install_path }}"
state: directory
owner: "{{ flink_user }}"
group: "{{ flink_group }}"
mode: 0755

- name: FLINK | Untar flink
unarchive:
extra_opts: ['--strip-components=1']
src: "{{ flink_bin_url }}"
remote_src: true
dest: "{{ flink_install_path }}"
owner: "{{ flink_user }}"
group: "{{ flink_group }}"
when: 'flink_force_reinstall or flink_check is failed or flink_check.stdout|length == 0'

0 comments on commit 9ccb696

Please sign in to comment.