Score:0

How can I download latest build with Ansible win_get_url module?

uz flag

I try to download the latest installation file from our JFrog repository with the following task:

- name: Download Server.msi file from JFrog repository
  ansible.windows.win_get_url:
    url: "{{ jfrog_url }}/Product/20.100.999.4112/x64/Server.msi"
    dest: C:\Server.msi
    url_username: "{{ jfrog_username }}"
    url_password: "{{ jfrog_password }}"
    validate_certs: no

Currently, the URL points to a specific version (i.e /20.100.999.4112/)
As you can see the folder name hold the version number of the build
How can I edit this task in a way that it will download latest file each time?

in flag
Find a resource that lists the releases.
uz flag
@GeraldSchneider After a search I made - we have no such a thing. What are my options in this situation? and can I concatenate a (latest) build.timestamp or (latest) build.number variable to the url?
in flag
You need some way to get the highest available version. If you don't have one you will have to change it manually. A directory listing would be sufficient.
in flag
It sounds like this is an internal server under your control. If you configure it to allow directory listing under `{{ jfrog_url }}/Product/` that would be enough.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.