Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Download artifact from JFrog Artifactory by using Ansible playbook

Tags:

ansible

I created a Maven repository and uploaded the artifacts into this repository.

I am now trying to download the artifact from JFrog artifact repository by using Ansible playbook. i have written the playbook like this.

- hosts: localhost
  tasks:
   - name: check the latest version file
     get_url:
       url: https://artifactory.com:8081/artifactory/Examplemavenrepo/ext- 
       release-local/anil.tar.gz
       dest: /home/anil/
       checksum: sha256:b2d62aab354a581b3d578c56506321924b2ebc36823f1c527dc6091bd51459e6

I getting this error:

fatal: [localhost]: FAILED! => {
  "changed": false,
  "dest": "/home/anil",
  "msg": "Request failed", "response": "HTTP Error 404: Not Found",
  "state": "absent",
  "status_code": 404,
  "url": "https://artifactory.com:8081/artifactory/Examplemavenrepo/ext-release-local/anil.tar.gz"
}

After this, i also tried by using api key, i got same error as above

like image 782
anil k Avatar asked Nov 17 '25 03:11

anil k


1 Answers

You can use your username and API key to download the artifact.

---
- name: Download artifact test
  become: true
  get_url:
    url: your_artifact_url_here
    dest: your_dest_folder_here
    url_username: your_username
    url_password: your_api_key

To get your api_key Go to artifactory url click on your account in the top-right corner and go to edit your profile. Enter your local password one more time to access the page and change your password. On that page, you will see your REST API Key, and Encrypted Password that you can use.

like image 159
sabhika Avatar answered Nov 21 '25 10:11

sabhika



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!