Regarding get_url issue in ansible

173 views
Skip to first unread message

Ashok Reddy

unread,
Apr 19, 2022, 7:42:28 AM4/19/22
to Ansible Project
- name: Download dms ear file to local
      get_url:
        url: "https://artifactory.sicpa.com/artifactory/{{ artifactory_folder }}/com/sicpa/gssd/tt040_my/server/dms/tt040_my-dms-ear/{{ dms_release_version }}/tt040_my-dms-ear-{{ dms_release_version }}.ear"
        dest: /tmp
        url_username: "{{ v_artifactory_user }}"
        url_password: "{{ v_artifactory_passwd }}"
        force_basic_auth: yes
      delegate_to: localhost
      #run_once: true
      tags: deploy_dms    


error:

TASK [Download dms ear file to local] ****************************************** [0;31mfatal: [dmsdb.tt040int.dev.sicpa.io -> localhost]: FAILED! => {"changed": false, "dest": "/tmp", "elapsed": 0, "gid": 0, "group": "root", "mode": "01777", "msg": "Request failed", "owner": "root", "response": "HTTP Error 409: Conflict", "size": 196, "state": "directory", "status_code": 409, "uid": 0, "url": "https://artifactory.sicpa.com/artifactory/gssd-dev-snapshots-local/com/sicpa/gssd/tt040_my/server/dms/tt040_my-dms-ear/2.6.0/tt040_my-dms-ear-2.6.0.ear"} [0m

dulh...@mailbox.org

unread,
Apr 19, 2022, 12:04:21 PM4/19/22
to ansible...@googlegroups.com
I was under the impression that delegate_to comes prior the TASK's details, like

- name: Download dms ear file to local
    delegate_to: localhost

    get_url:
      url: "https://artifactory.sicpa.com/artifactory/{{ artifactory_folder }}/com/sicpa/gssd/tt040_my/server/dms/tt040_my-dms-ear/{{ dms_release_version }}/tt040_my-dms-ear-{{ dms_release_version }}.ear"
      dest: /tmp
      url_username: "{{ v_artifactory_user }}"
      url_password: "{{ v_artifactory_passwd }}"
      force_basic_auth: yes
      #run_once: true
    tags: deploy_dms    


that aside the error messages makes me think to investigate what HTTP Error 409 is and go further down that road
--
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/f68918ba-c58a-466a-a11b-ebf1dc124ccfn%40googlegroups.com.

Ashok Reddy

unread,
Apr 21, 2022, 1:13:35 AM4/21/22
to Ansible Project
Yes I agree with you I have tried to narrow down the issue based on the https status error 409 but could n't be able to figure out.
Let me try once . Thanks for all your help.

Ashok Reddy

unread,
Apr 26, 2022, 7:25:56 AM4/26/22
to Ansible Project
Hi ,

Can some one help me the issue?

I could n't be able to figure it out .

Dick Visser

unread,
Apr 26, 2022, 12:12:54 PM4/26/22
to ansible...@googlegroups.com
On 2022-04-26 (Tue) 13:25, Ashok Reddy wrote:
> Hi ,
>
> Can some one help me the issue?
>
> I could n't be able to figure it out .

The error you're getting is from the API at
https://artifactory.sicpa.com, and has nothing to do with the ansible
get_url module that is used to interact with it.

get_url is merely a conveyor belt that is used to send your (incorrect)
data.

You should find out how that API is supposed to be used.


--
Dick Visser
GÉANT
OpenPGP_signature

Ashok Reddy

unread,
May 4, 2022, 10:40:13 PM5/4/22
to Ansible Project
Thanks for your input, but not sure how to verify jfrog API?
Can you please help me, meanwhile I can try to figure it?

Note: r u suggesting me to check jfrog API or else?

Dick Visser

unread,
May 4, 2022, 11:03:13 PM5/4/22
to ansible...@googlegroups.com
I don't know what 'jfrog' is and what that has to do with this. Either way you should consult the docs for the api you're trying to use, which (from your playbook and errors) is at 

https://artifactory.sicpa.com/.

That should give you the information you need, to avoid errors like you got. 



Sent from a mobile device

From: ansible...@googlegroups.com <ansible...@googlegroups.com> on behalf of Ashok Reddy <ashok...@gmail.com>
Sent: Thursday, May 5, 2022 4:40:13 AM
To: Ansible Project <ansible...@googlegroups.com>
Subject: Re: [ansible-project] Regarding get_url issue in ansible
 
--
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.

Ashok Reddy

unread,
May 5, 2022, 6:00:50 AM5/5/22
to Ansible Project
Ok got it let me try.

I have written some code in ansible.
Can you please let me know, whether it is syntax wise correct or not?

ansible-playbook --extra-vars "artifactory_folder=gssd-dev-snapshots-local" playbooks/deploy.yml

Dick Visser

unread,
May 5, 2022, 8:03:23 AM5/5/22
to ansible...@googlegroups.com
That syntax is OK, but your problem isn't about the syntax.
It's about the content that you post to the API.

I will tell you one more time: your problem is NOT with ansible.
Ansible is irrelevant in this case.

Your problem is with the data you post to the API.

Find a solution for that, phone up the admins of your API, read the
docs, or do something else.


Dick




On 2022-05-05 (Thu) 12:00, Ashok Reddy wrote:
> Ok got it let me try.
>
> I have written some code in ansible.
> Can you please let me know, whether it is syntax wise correct or not?
>
> ansible-playbook --extra-vars
> "artifactory_folder=gssd-dev-snapshots-local" playbooks/deploy.yml
>
>
>
> On Thursday, May 5, 2022 at 5:03:13 AM UTC+2 dick....@geant.org wrote:
>
> I don't know what 'jfrog' is and what that has to do with this.
> Either way you should consult the docs for the api you're trying to
> use, which (from your playbook and errors) is at
>
> https://artifactory.sicpa.com/ <https://artifactory.sicpa.com/>.
>
> That should give you the information you need, to avoid errors like
> you got.
>
>
>
> Sent from a mobile device
> ------------------------------------------------------------------------
> *From:* ansible...@googlegroups.com <ansible...@googlegroups.com> on
> behalf of Ashok Reddy <ashok...@gmail.com>
> *Sent:* Thursday, May 5, 2022 4:40:13 AM
> *To:* Ansible Project <ansible...@googlegroups.com>
> *Subject:* Re: [ansible-project] Regarding get_url issue in ansible
> Thanks for your input, but not sure how to verify jfrog API?
> Can you please help me, meanwhile I can try to figure it?
>
> Note: r u suggesting me to check jfrog API or else?
>
> On Tuesday, April 26, 2022 at 6:12:54 PM UTC+2 dick....@geant.org wrote:
>
> On 2022-04-26 (Tue) 13:25, Ashok Reddy wrote:
> > Hi ,
> >
> > Can some one help me the issue?
> >
> > I could n't be able to figure it out .
>
> The error you're getting is from the API at
> https://artifactory.sicpa.com <https://artifactory.sicpa.com>,
> and has nothing to do with the ansible
> get_url module that is used to interact with it.
>
> get_url is merely a conveyor belt that is used to send your
> (incorrect)
> data.
>
> You should find out how that API is supposed to be used.
>
>
> --
> Dick Visser
> GÉANT
>
> --
> 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/d1807bab-e5b4-4c68-b974-1a5f14dce4c1n%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/d1807bab-e5b4-4c68-b974-1a5f14dce4c1n%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> 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
> <mailto:ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/d8669df7-cc18-4dc9-aecb-e3df88a79133n%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/d8669df7-cc18-4dc9-aecb-e3df88a79133n%40googlegroups.com?utm_medium=email&utm_source=footer>.
OpenPGP_0x266713D4E6EF488D.asc
OpenPGP_signature

David Logan

unread,
May 5, 2022, 9:15:53 AM5/5/22
to ansible...@googlegroups.com
Hi Ashok,

It does appear as though the task has done its work well, there is an article here https://jfrog.com/knowledge-base/how-to-resolve-the-replication-error-conflict-409/ that should be able to give you an indicator as to what has gone wrong. The actual api is documented here https://www.jfrog.com/confluence/display/JFROG/Artifactory+REST+API

Regards



--
if in trouble, or in doubt
run in circles, scream and shout
Reply all
Reply to author
Forward
0 new messages