Sorry, I made mistake. Bad example. I meant this one:
$ cat inv
local ansible_connection=local
$ cat extra.yml
---
- set_fact: bar=hello
- debug: msg="baz {{ bar }}"
$ cat playbook.yml
---
- hosts: local
tasks:
- include: extra.yml
when: bar is not defined
$ ansible-playbook -i inv playbook.yml
PLAY [local]
******************************************************************
GATHERING FACTS
***************************************************************
ok: [local]
TASK: [set_fact bar=hello]
****************************************************
ok: [local]
TASK: [debug msg="baz {{ bar }}"]
*********************************************
skipping: [local]
PLAY RECAP
********************************************************************
local : ok=2 changed=0 unreachable=0 failed=0
$
W dniu wtorek, 11 listopada 2014 17:01:21 UTC+1 użytkownik Brian Coca
napisał:
>
> cause you asked it to?
>
> I think you want:
>
> ```
> when: bar is defined
> ```
>
> --
> Brian Coca
>
--
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/b787f17d-5313-4339-8e2b-6e92d38e245f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.