1

I want to download the latest appimage of bitwarden, but only if the downloadable version is newer than the local one.

- name: Download and place Bitwarden Appimage
  get_url:
    url: "https://vault.bitwarden.com/download/?app=desktop&platform=linux"
    follow: yes
    dest: /home/user
    register: foo
  when: foo !== /home/user/Bitwarden-{1....9}-x86_64.AppImage

Is it possible to do this within the same task, or do I have to split it up over 2? Also is the regex syntax correct? The current version is: 1.25.1

  • Basic walk-through: use the `uri` module to call the first above url without following the 302 redirection. Extract the full redirection url and the filename from the response. Then use `uri` or `get_url` to call the full redirection url returned from previous task and use the filename in the [`creates` module option](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/uri_module.html#parameter-creates) (link is for `uri`, same option exists in `get_url`). That second task will only download if the given file does not already exists. – Zeitounator Mar 21 '21 at 09:46
  • Sounds promising, but I have Syntax issues with my regex and the `creates` option. There is no example on how to use creates. Do I have to call the registered var in creates? – G4nja Wizard Mar 21 '21 at 16:39

0 Answers0