Hi all,

The ansible docs, here 
<http://docs.ansible.com/ansible/playbooks_variables.html#variables-defined-in-a-playbook>,
 
claim that you can assign a variable to a host inline in a playbook. Then, 
here 
<http://docs.ansible.com/ansible/playbooks_conditionals.html#applying-when-to-roles-and-includes>,
 
it says you can use "when" paired with a variable to run certain roles on 
certain hosts. Why then, does this not work?

---
- hosts: "{{ log_srv }}"
  vars: 
    type: syslog
  roles:
    - syslog-server

- hosts: all
  roles:
    - { role: syslog-client, when type == "syslog" }

The first play runs fine, only on the server/s defined in the "log_srv" 
flag. But the second play runs on all servers, instead of just on the one/s 
from the first play. What am I doing wrong?

Thanks in advance.

-- 
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/a5e878aa-1f89-4a67-8a8f-4896c6529497%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to