[ansible-project] conditional with register in one task?

2015-03-12 Thread Marc Patermann
Hi, should this work: tasks: - name: test shell: uname -a when: env == test - name: test 1 file: path=/opt/test.txt state=touch when: env == test1 register: test_1 - name: test 2 file: path=/opt/test2 state=touch when: test_1 is defined Task test 1

Re: [ansible-project] conditional with register in one task?

2015-03-12 Thread Marc Patermann
Matt, Matt Martz schrieb (11.03.2015 16:08 Uhr): Even though a task is skipped, the registered variable is still created. You would want to check something like the following on your test 2 task instead: when: not test_1|skipped this works, thank you! The docs could be a bit clearer about

Re: [ansible-project] conditional with register in one task?

2015-03-11 Thread Matt Martz
Even though a task is skipped, the registered variable is still created. You would want to check something like the following on your test 2 task instead: when: not test_1|skipped On Wed, Mar 11, 2015 at 10:06 AM, Marc Patermann hans.mo...@ofd-z.niedersachsen.de wrote: Hi, should this work: