Actually, this works just fine (tested with ansible-playbook 2.1.1.0)
until: get_url_result | succeeded
Le vendredi 2 janvier 2015 16:42:25 UTC+1, Martin Palecek a écrit :
>
> If the file is already present, then the get_url_result.msg does not
> contain 'OK'. I had to use
> until: "'OK' in get_url_result.msg or 'file already exists' in
> get_url_result.msg"
>
> On Thursday, 16 October 2014 15:35:34 UTC+2, Daniel Laird wrote:
>>
>> For the benefit of all this seemed to solve it:
>> get_url: url=pkg_name.tar.bz2 dest=/opt/DIR_NAME force=yes
>> url_password={{ svn_password }} url_username={{ svn_username }} use_proxy=no
>> register: get_url_result
>> until: "'OK' in get_url_result.msg"
>> retries: 5
>> delay: 10
>> with_items: pkg_list
>>
>> cheers
>> Dan
>>
>>
>>
>> On Tuesday, 23 September 2014 20:19:59 UTC+1, Michael DeHaan wrote:
>>>
>>> A good way to check a return value is:
>>>
>>> - debug: var=registered_variable_name
>>>
>>> In this case, you should get an arrayed result.
>>>
>>> Let us know what specific problems you are having as I have trouble
>>> parsing what "doesn't work" means usually :)
>>>
>>> Thanks!
>>>
>>>
>>>
>>> On Mon, Sep 22, 2014 at 11:08 AM, Daniel Laird <
>>> [email protected]> wrote:
>>>
>>>> All,
>>>>
>>>> New to ansible and struggling a bit.
>>>>
>>>> I want to use get_url on a list of files. But also due to issues with
>>>> the server I am downloading from I want to retry the download on failure.
>>>> I have something like this:
>>>>
>>>> - name: Download the packages
>>>> get_url: url=pkg_name.tar.bz2 dest=/opt/DIR_NAME force=yes
>>>> url_password={{ svn_password }} url_username={{ svn_username }}
>>>> use_proxy=no
>>>> register: get_url_result
>>>> until: get_url_result.rc == 0
>>>> retries: 5
>>>> delay: 10
>>>> with_items: pkg_list
>>>>
>>>> Is this possible?
>>>> I cant seem to get the logic right or find out what the get_url returns
>>>> in the failure case.
>>>> I just want to try no more than 5 times for each pkg in the package
>>>> list.
>>>>
>>>> Cheers
>>>> Dan
>>>>
>>>> --
>>>> 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 [email protected].
>>>> To post to this group, send email to [email protected].
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/ansible-project/1587e35f-0a54-4f72-8383-e0e86850d324%40googlegroups.com
>>>>
>>>> <https://groups.google.com/d/msgid/ansible-project/1587e35f-0a54-4f72-8383-e0e86850d324%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
--
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/bac615d3-e6c8-419c-8abf-c92bae5db0d9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.