ansible-collections / ansible.windows

Windows core collection for Ansible
https://galaxy.ansible.com/ansible/windows
GNU General Public License v3.0
233 stars 157 forks source link

win_package: support checksum verification #596

Open mathstuf opened 3 months ago

mathstuf commented 3 months ago
SUMMARY

win_package should support checksum verification of network downloads

ISSUE TYPE
COMPONENT NAME

ansible.windows.win_package

ADDITIONAL INFORMATION

Verify that the downloaded file is the one expected before execution.

- name: Install foobar
  ansible.windows.win_package:
    path: '{{ some_network_url }}'
    checksum: 'sha256sum:deadbeef…'
jborean93 commented 3 months ago

This seems like a simple thing to implement. I'm not sure whether to split the algorithm selection into another option or to have the prefix like you've specified here or not though.

mathstuf commented 3 months ago

The Posix actions seem to use prefixes but Windows-specific actions seem to prefer split. I certainly prefer the former as it is one less variable to juggle, but consistency might be more valuable…