"PUTTING" or http PUT interacting with JFrog Artifactory

67 views
Skip to first unread message

GM

unread,
Aug 16, 2019, 8:08:54 AM8/16/19
to Ansible Project
Hey everyone - if I was going to use an Ansible module to push or PUT a file into say JFrog Artfactory, using an API key, which of the Ansible modules would be best? I have looked at the uri module and the net_put but those do not seem to have the functionality that I would need.

I see get_url but that seems to be for the direction from the destination to the source.

Can anyone shed some light? Which module would be best for this job? I have never had to do this before and I'm a little lost.

Thanks - Glen

Zolvaring

unread,
Aug 16, 2019, 12:00:30 PM8/16/19
to ansible...@googlegroups.com
To put or post a file to an API I would usually use the uri module. Are you able to explain more what it seems to be missing or post an example? Thanks

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/a3fe4bd4-cf3f-4789-9c89-4fd55d2b36eb%40googlegroups.com.

GM

unread,
Aug 16, 2019, 12:49:55 PM8/16/19
to Ansible Project
Oh - yes.

Here is the scenario:

I have a JFrog Artifactory server, and I want to use Ansible to upoload/PUT files into the repos that I have in Artifactory. - attempting to use the uri module:

I posted what I had below - I am missing something I am sure.

Am I going about this the wrong way? Thanks for any help you can offer. It's appreciated.

---
- name: "download artifact"
  hosts: all
  tasks:
  - uri:
      user: gmillard
      password: xxxxxxxxx
      method: PUT
      src: FilesArchive.tar.gz



ansible-playbook -vv attemptul.yml
ansible-playbook 2.5.2
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/gmillard/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible-playbook
  python version = 2.7.15 (default, May  9 2018, 11:32:33) [GCC 7.3.1 20180130 (Red Hat 7.3.1-2)]
Using /etc/ansible/ansible.cfg as config file

PLAYBOOK: attemptul.yml ****************************************************************************************************************************************************************
1 plays in attemptul.yml

PLAY [download artifact] ***************************************************************************************************************************************************************

TASK [Gathering Facts] *****************************************************************************************************************************************************************
task path: /home/gmillard/myplatform/OtherStuff/attemptul.yml:2
ok: [fedoracontrol]
META: ran handlers

TASK [uri] *****************************************************************************************************************************************************************************
task path: /home/gmillard/myplatform/OtherStuff/attemptul.yml:5
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'NoneType' object has no attribute 'find'
fatal: [fedoracontrol]: FAILED! => {"changed": false, "content": "", "msg": "Status code was -1 and not [200]: An unknown error occurred: 'NoneType' object has no attribute 'find'", "redirected": false, "status": -1, "url": null}
        to retry, use: --limit @/home/gmillard/myplatform/OtherStuff/attemptul.retry

PLAY RECAP *****************************************************************************************************************************************************************************
fedoracontrol              : ok=1    changed=0    unreachable=0    failed=1


Glen

vinoth kumar

unread,
Aug 18, 2019, 2:06:59 PM8/18/19
to ansible...@googlegroups.com
Hi 
Use status code with respective error and try again 

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages