Variabilisation of url with url_get to download a file on artifactory

54 views
Skip to first unread message

guillaume payen

unread,
Jan 6, 2022, 9:37:51 AM1/6/22
to Ansible Project
Hello ! I am new on Ansible and wanted to know if there was an easy way to download the last or specified version of a file from an artifactory repo.

Here is what i am trying to do :
vars:
    artifactory_base_url: https://artifactorybaseUrl/

- name: Download artifact
      get_url:
          url: {{ item }}
          dest: /someDir/
      with_items:
          - {{ artifactory_base_url }}/someArtifactDir/{{ versionA1 }}/*.tar.gz
          - {{ artifactory_base_url }}/someArtifactDir2/{{ versionA2 }}/*.tar.gz

versionA1 and versionA2 are extra_vars given by some jenkins, the idea beeing to download the tar.gz file in each directory since the files names are not the best and i'd like to be able to only give the wanted version as initial information.

Is there a way to do this ? Or am i totally missing something and there an other module to do this better ?
Reply all
Reply to author
Forward
0 new messages