Re: [ansible-project] with_sequence is incompatible with idempotency

2014-05-01 Thread Philippe Eveque
In similar case A workaround I used is to add 1 to your sequence count see https://mail.google.com/mail/#search/label%3Aansible+with_sequence/1435e13b34e3a0e1 Phil 2014-04-30 23:51 GMT+02:00 kesten broughton kesten.brough...@gmail.com: The error is fatal: [localhost] = can't count backwards

Re: [ansible-project] with_sequence is incompatible with idempotency

2014-05-01 Thread kesten broughton
Phil, the link doesn't work for me. On Thursday, May 1, 2014 2:32:23 AM UTC-5, Philippe Eveque wrote: In similar case A workaround I used is to add 1 to your sequence count see https://mail.google.com/mail/#search/label%3Aansible+with_sequence/1435e13b34e3a0e1 Phil 2014-04-30 23:51

Re: [ansible-project] with_sequence is incompatible with idempotency

2014-05-01 Thread Philippe Eveque
The link references a previous exchange similar to yours The specific case was about using the lineinfile module and with_sequence to add a parameter to all the kernel liles in grub.conf here is a copy of what I wrote: tasks 1: count the number of lines to replace (via shell module using and

Re: [ansible-project] with_sequence is incompatible with idempotency

2014-05-01 Thread kesten broughton
ah, thanks phillippe. I think in my case this won't work since i DO care about doing it one more time. The thing i'm doing is creating vms. But i don't want to create 1 more if i already have my desired N. k On Thu, May 1, 2014 at 2:17 PM, Philippe Eveque philippe.eve...@gmail.comwrote: The

Re: [ansible-project] with_sequence is incompatible with idempotency

2014-05-01 Thread Michael DeHaan
So it seems easiest to just make it so it can create zero length lists. Please make sure there's a github ticket and this can be dealt with. Tickets go here: github.com/ansible/ansible (Fix pull requests are even better) Thanks! On Thu, May 1, 2014 at 3:52 PM, Philippe Eveque

[ansible-project] with_sequence is incompatible with idempotency

2014-04-30 Thread Kesten Broughton
I recently had a need for with_sequence, but it doesn't seem possible to do a zero count of actions. Suppose i have a local action to create N things, perhaps vms or floating ips. Some number M N may already be present. I'd like to do hosts: localhost vars: expected_foo_count: 10 - name:

Re: [ansible-project] with_sequence is incompatible with idempotency

2014-04-30 Thread Michael DeHaan
You are throwing two words together that have nothing to do with each other. with_sequence is a loop. Idempotency is a mathematical statement that says F(X) = F(F(X)) for how many times X is applied. This will work if M is strictly less than N, but if M=N (the idempotent case) then ansible

Re: [ansible-project] with_sequence is incompatible with idempotency

2014-04-30 Thread kesten broughton
The error is fatal: [localhost] = can't count backwards This occurs whenever count=0 or start=M end=M If with_sequence is used for the purpose of bringing a system to a state = HAS N of something then there should be a way of running the playbook twice and not having anything new created.