Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

win_get_url dest uses URL symlink filename vs actual filename #456

Open
slalomnut opened this issue Dec 6, 2022 · 1 comment
Open

win_get_url dest uses URL symlink filename vs actual filename #456

slalomnut opened this issue Dec 6, 2022 · 1 comment

Comments

@slalomnut
Copy link

slalomnut commented Dec 6, 2022

- name: Download latest Corretto
  win_get_url: 
    url: https://corretto.aws/downloads/latest/amazon-corretto-11-x64-windows-jdk.msi
    dest: '{{ software_repo }}\JAVA\corretto'
  register: corretto_dl_results

Output:

ok: [localhost] => {
    "corretto_dl_results": {
        "changed": true, 
        "checksum_dest": "8d05f79384e472ba9bbbcd34c31dedd7148dd18e", 
        "checksum_src": "8d05f79384e472ba9bbbcd34c31dedd7148dd18e", 
        "**dest**": "\\\\host.domain.com\\software\\JAVA\\corretto\\**amazon-corretto-11-x64-windows-jdk.msi**", 
        "elapsed": 16.6723715, 
        "failed": false, 
        "msg": "OK", 
        "size": 168034304, 
        "status_code": 200, 
        "url": "https://corretto.aws/downloads/latest/amazon-corretto-11-x64-windows-jdk.msi"

VS.

    - name: Download latest Corretto
      get_url: 
        url: https://corretto.aws/downloads/latest/amazon-corretto-11-x64-windows-jdk.msi
        dest: /tmp
      register: corretto_dl_results

Output:

ok: [localhost] => {
    "corretto_dl_results": {
        "changed": false, 
        "checksum_dest": "8d05f79384e472ba9bbbcd34c31dedd7148dd18e", 
        "checksum_src": "8d05f79384e472ba9bbbcd34c31dedd7148dd18e", 
        "**dest**": "/tmp/**amazon-corretto-11.0.17.8.1-windows-x64.msi**", 
        "elapsed": 140, 
        "failed": false, 
        "gid": ###, 
        "group": "group", 
        "md5sum": "a99b09ae4337926cad43283c12dc1d8f", 
        "mode": "0644", 
        "msg": "OK (168034304 bytes)", 
        "owner": "username", 
        "secontext": "unconfined_u:object_r:user_tmp_t:s0", 
        "size": 168034304, 
        "src": "/home/username/.ansible/tmp/ansible-tmp-1670353734.18-24714-64356351146486/tmp7ddMAT", 
        "state": "file", 
        "status_code": 200, 
        "uid": ###, 
        "url": "https://corretto.aws/downloads/latest/amazon-corretto-11-x64-windows-jdk.msi"
@jborean93
Copy link
Collaborator

The problem is win_get_url tries to resolve the destination file name before it sends the request, so all it knows is the URL given to it. While I see get_url will append the filename based on the final URL used, the win_get_url will need to be updated to do the same thing here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants