--To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/63014730-309e-44a9-b2c6-400b9a7d5388%40googlegroups.com.
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.
--
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/cb1bea17-3025-426e-b576-408a0dafad4c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/53ABC4BB.8020901%40yahoo.gr.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/53ABC4BB.8020901%40yahoo.gr.
- include: warmup.yml register: result until: result.stdout.find("all systems go") != -1 retries: 5 delay: 10
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/b19d8e1d-db1a-4d82-8e82-ab17209767cb%40googlegroups.com.
"Adding some details:1. node A is running some java app2. node B is running another app which in turn can generate some 'load' for node A
in terms of states I need not only have app 'started' on node A but also have it 'warmed up'. as warming up a java process is a complex task the only way to put app in 'warmed up' state is to organize feedback loop between A and B and stop warmup runs (on B) as soon as number of compiled/recompiled methods by hotspot drops to certain level. At this point you'll get some 'confidence' that app is warmed up and you can proceed further
ansible has a way of repeating single task but for some (may be good) reason there is no way of repeating 'composite task' (which is what roles are to my understanding) "
- hosts: javatasks:- # steps to wait for it to be started
- hosts: load_generatorstasks:- # steps to generate load against java boxes, using delegate_to: "{{ item }}" and with_items: groups.java ?
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgyiE4zPtS%3DBBr02QJL9HEP%3DFZLdnncxWDRCSsQ8HbXGPw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/53AC5662.3090801%40yahoo.gr.
"It is that repetition that Ansible cannot currently handle."
I'm not sure that's true.
Ansible has loops and things like with_sequence, as well as do_until loops.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgycGhiLGTS0wn6-FJywp1KKzxo3MevNd%3DyjNb17xGbJWQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/53AC5993.8040201%40yahoo.gr.
"Ansible can do this kind of loops, but only for a single task. It does not offer a way to repeat a number of different tasks as a group."
Agreed, we really aren't trying to create a programming language.
Do you have to be as careful with generating exactly a certain amount of load?
I would ordinarily think a script (called by ansible of course) could be created that generates a certain amount of load and that would be predictable enough to warm up most things.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgwUcZAAQwvMUbRSRywBeZda8hubDwh-ejHHkUqd_eUVfA%40mail.gmail.com.
When a need to support a common task execution scenario arises and Ansible cannot handle it, I consider it a limitation. We are not trying to create a programming language, but we are all using Ansible to script task execution scenarios. I expect to be able to tell my machines "repeat that group of tasks until something becomes ready or reaches some limit". This is speaking to my machines and telling them what to do, it's not programming. I think Ansible can be improved on that aspect.On 06/26/14 21:06, Michael DeHaan wrote:
"Ansible can do this kind of loops, but only for a single task. It does not offer a way to repeat a number of different tasks as a group."
Agreed, we really aren't trying to create a programming language.
It's not about being that careful but rather about getting to predictable result as soon as possible.As I mentioned warming up of java program is a complex thing and depends heavily on jvm version/ switches as well as load 'patterns'. In my case everything could change.. So to answer your question yes it's possible to get guaranteed warm up ... but the cost of such guarantee would be high (for my use case) - for sure app will be warmed up after half an hour of running load generators..i'm fine with hybrid solution (i.e to run ansible from within a shell script then run some 'imperative' logic .. just trying to pull as much 'ssh' out of scripts as possible)
--
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/CA%2BnsWgxzeKsOvRPMMvbuaV72Cevm0-Nec0VFQedWLjBBU_UXNQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/53AD22F8.5080101%40yahoo.gr.
"It seems that you are not interested in going that direction with the excuse that more flexible loops are for programming languages."
These are project directions, not excuses, and we're mincing at words here.
Just so this isn't misinterpreted, Ansible already provides the ability to write custom iterators, we have things like "with_nested", "with_sequence", etc. It already can loop over single tasks quite fine,
So what you are asking about is the ability to loop over more than one set of tasks - I would not implement this as a "goback" even if we did this, it would be a higher level language construct, more akin to a block with control structures. Gotos are a gross construct nearly everywhere we are found.
In most cases it's not needed - Modules already take care of most of the provisioning needs, for instance, "exact_count" on provisioning modules allow spinning up an arbitrary number of images, and then you can apply tasks to images using the host loop. Thus we can ALREADY do all of that cluster spinup, and do that every day.
While looping over multiple tasks in a common loop could be something Ansible does in the future, we have a lot of more important things to chase first in the PR queue before we would consider such complexity when so few things need it. So far the only example we have that we "can't" do is "warm up group of servers A from load of B until servers A reach threshold X", which strikes me as very arbitrary.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgz%3DH1zun_xfbFCU0buvAzSQVDSm8a6hwxsLRCh8AH3cug%40mail.gmail.com.
with_items: cq_packages
roles/httpd/tasks/main.yml:
---
- block:
- include_vars: {{ item }}
- debug: msg="{{ field1 }} from with list"
- debug: msg="{{ field2 }} from with list"
- template: src="templates/site.conf.j2" dest="site.conf"
with_fileglob:
- vars/*.yml
---
- hosts: localhost
become: false
tasks:
- include: "roles/httpd/tasks/main.yml"
with_fileglob:
- vars/*.yml
---
- include_vars: "{{ item }}"
- debug: msg="{{ site_name }}"
---
site_name: "site1"
http_port: 8888
---
site_name: "site2"
http_port: 8899
--
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/61c4f6a8-100e-4829-8f01-cc0d72f21800%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.