--
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 post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/be63ee7b-502b-40a8-a776-cf05d8534c1c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
"I would like to be able to exit a with_items loop based on the result of the previous iteration. Think of it as a generalisation of with_first_found. "Would like to step back to use cases first before we propose it be done with the "with_<foo>" here, as that's not how that part works.Curious what kinds of files you are downloading - for instance, package managers like yum already do this, etc.
--
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 post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAAD%2BY3Vh7uwrAwTVVcDf-MkbciLOTn%3Dj-5WSbq9OQu%3D0puhR_Q%40mail.gmail.com.
if you are downloading tars of git repos from GitHub from lots of production servers, that seems to be a bit of a bad practice to me that assaults the mirror.
I would consider setting up a mirror of all that content on one server initially and then have your individual production nodes download off that box.
--
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 post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAAD%2BY3VzJH1cLe6QOBC%3DQ9z_YtZSes15Q0o%2BPj-Zd%2BEKgqKXFA%40mail.gmail.com.
- hosts: localhost
gather_facts: no
tasks:
- name: test
# action: debug msg="cluster host {{ item }}"
# action: uri timeout=2 url={{ item }}
action: shell curl --max-time 1 {{ item }} >/dev/null
with_items: "{{input_hosts|shuffle}}"
register: put_status
until: put_status.rc == 0
ansible-playbook -vv -i ../hosts --sudo test2.yml --extra-vars='{"input_hosts": ["https://www.google.com", "https://www.snargoblarg.com"]}'
PLAY [localhost] **************************************************************
TASK: [test] ******************************************************************
<127.0.0.1> REMOTE_MODULE command curl --max-time 1 https://www.google.com >/dev/null #USE_SHELL
changed: [127.0.0.1] => (item=https://www.google.com) => {"attempts": 0, "changed": true, "cmd": "curl --max-time 1 https://www.google.com >/dev/null", "delta": "0:00:00.555617", "end": "2016-01-04 23:32:04.951993", "item": "https://www.google.com", "rc": 0, "start": "2016-01-04 23:32:04.396376", "stderr": " % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r100 18908 0 18908 0 0 35322 0 --:--:-- --:--:-- --:--:-- 36152", "stdout": "", "warnings": ["Consider using get_url module rather than running curl"]}
<127.0.0.1> REMOTE_MODULE command curl --max-time 1 https://www.snargoblarg.com >/dev/null #USE_SHELL
<127.0.0.1> REMOTE_MODULE command curl --max-time 1 https://www.snargoblarg.com >/dev/null #USE_SHELL
Result from run 1 is: {'cmd': 'curl --max-time 1 https://www.snargoblarg.com >/dev/null', 'end': '2016-01-04 23:32:11.354140', 'stdout': u'', 'changed': True, 'attempts': 1, 'start': '2016-01-04 23:32:11.188499', 'delta': '0:00:00.165641', 'stderr': ' % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (6) Could not resolve host: www.snargoblarg.com', 'rc': 6, 'warnings': ['Consider using get_url module rather than running curl']}
<127.0.0.1> REMOTE_MODULE command curl --max-time 1 https://www.snargoblarg.com >/dev/null #USE_SHELL
Result from run 2 is: {'cmd': 'curl --max-time 1 https://www.snargoblarg.com >/dev/null', 'end': '2016-01-04 23:32:16.868708', 'stdout': u'', 'changed': True, 'attempts': 2, 'start': '2016-01-04 23:32:16.703207', 'delta': '0:00:00.165501', 'stderr': ' % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (6) Could not resolve host: www.snargoblarg.com', 'rc': 6, 'warnings': ['Consider using get_url module rather than running curl']}
<127.0.0.1> REMOTE_MODULE command curl --max-time 1 https://www.snargoblarg.com >/dev/null #USE_SHELL
Result from run 3 is: {'cmd': 'curl --max-time 1 https://www.snargoblarg.com >/dev/null', 'end': '2016-01-04 23:32:22.253845', 'stdout': u'', 'changed': True, 'attempts': 3, 'start': '2016-01-04 23:32:22.231865', 'delta': '0:00:00.021980', 'stderr': ' % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (6) Could not resolve host: www.snargoblarg.com', 'rc': 6, 'warnings': ['Consider using get_url module rather than running curl']}
failed: [127.0.0.1] => (item=https://www.snargoblarg.com) => {"attempts": 3, "changed": true, "cmd": "curl --max-time 1 https://www.snargoblarg.com >/dev/null", "delta": "0:00:00.021980", "end": "2016-01-04 23:32:22.253845", "failed": true, "item": "https://www.snargoblarg.com", "rc": 6, "start": "2016-01-04 23:32:22.231865", "warnings": ["Consider using get_url module rather than running curl"]}
stderr: % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (6) Could not resolve host: www.snargoblarg.com
msg: Task failed as maximum retries was encountered
FATAL: all hosts have already failed -- aborting