42 lines
1.7 KiB
YAML
42 lines
1.7 KiB
YAML
- name: Check {{ app_label }} {{ app_version }} executable checksum
|
|
register: "exe_checksum_result"
|
|
ansible.windows.win_stat:
|
|
path: "{{ app_exe_path }}"
|
|
get_checksum: yes
|
|
checksum_algorithm: "{{ app_checksum_type }}"
|
|
|
|
- name: Download & install {{ app_label }} {{ app_version }}
|
|
when: exe_checksum_result.stat.exists == false or exe_checksum_result.stat.checksum != app_exe_checksum
|
|
block:
|
|
- name: Download {{ app_label }} {{ app_version }}
|
|
register: app_download_result
|
|
ansible.windows.win_get_url:
|
|
url: "{{ app_download_url }}"
|
|
dest: "{{ download_dir }}"
|
|
checksum: "{{ app_download_checksum }}"
|
|
checksum_algorithm: "{{ app_checksum_type }}"
|
|
force: false
|
|
|
|
- name: Install {{ app_label }} {{ app_version }}
|
|
ansible.windows.win_command: "{{ install_command }}"
|
|
loop: "{{ app_install_commands }}"
|
|
loop_control:
|
|
loop_var: install_command
|
|
|
|
- name: Verify {{ app_label }} {{ app_version }} executable checksum
|
|
register: exe_checksum_verify_result
|
|
ansible.windows.win_stat:
|
|
path: "{{ app_exe_path }}"
|
|
get_checksum: yes
|
|
checksum_algorithm: "{{ app_checksum_type }}"
|
|
failed_when: exe_checksum_verify_result.stat.exists == false
|
|
|
|
- name: Output {{ app_label }} {{ app_version }} executable checksum
|
|
ansible.builtin.debug:
|
|
msg: |
|
|
"{{ exe_checksum_verify_result.stat.path }}"
|
|
" expect: {{ app_exe_checksum }}"
|
|
" actual: {{ exe_checksum_verify_result.stat.checksum }}"
|
|
failed_when: exe_checksum_verify_result.stat.checksum != app_exe_checksum
|
|
|