I’m trying to install Docker Desktop on my Ubuntu using Ansible.
Here is the official manual:
https://docs.docker.com/desktop/install/ubuntu/#install-docker-desktop
You can see that the link to dep package looks like this:
https://desktop.docker.com/linux/main/amd64/149282/docker-desktop-4.30.0-amd64.deb
How can ansible always install the latest version without hardcoding the version number (4.30.0) and some other number (149282) in the playbook or in variables. The playbook has to get the actual link to the latest version itself from somewhere. How can this be done?
I’ve tried to find a ready-made role for installing Docker Desktop on Ubuntu/Debian/Linux, but it seems everywhere just hardcoded links are used, e.g.:
- name: "download docker desktop"
ansible.builtin.get_url:
url: "https://desktop.docker.com/linux/main/amd64/149282/docker-desktop-4.30.0-amd64.deb"
dest: "/tmp/docker-desktop.deb"