DEVenv/Dev2/install_from_archive.yml

42 lines
1.7 KiB
YAML
Raw Normal View History

2023-01-21 09:30:49 +00:00
- name: Check {{ app_label }} {{ app_version }} executable checksum
register: "exe_checksum_result"
2023-01-21 06:55:57 +00:00
ansible.windows.win_stat:
2023-01-21 09:30:49 +00:00
path: "{{ app_exe_path }}"
2023-01-21 06:55:57 +00:00
get_checksum: yes
2023-01-21 09:30:49 +00:00
checksum_algorithm: "{{ app_checksum_type }}"
2023-01-21 06:55:57 +00:00
2023-01-22 08:57:47 +00:00
- name: Download & install {{ app_label }} {{ app_version }}
2023-01-21 09:30:49 +00:00
when: exe_checksum_result.stat.exists == false or exe_checksum_result.stat.checksum != app_exe_checksum
2023-01-22 08:57:47 +00:00
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
2023-01-21 06:55:57 +00:00
2023-01-22 08:57:47 +00:00
- 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
2023-01-21 06:55:57 +00:00