I have three sets of servers. Depending on the hostname, I want the client 
to grab the correct file. I tested the playbook on a server with the word 
"batch" but it picks up both files (group_vars/perl and group_vars/perl).

pre_tasks:
  - include_vars: group_vars/web
    when: "'web' in ansible_hostname"
  - include_vars: group_vars/batch
    when: "'web' not in ansible_hostname"
  - include_vars: group_vars/perl
    when: "'web' not in ansible_hostname" or "'batch' not in 
ansible_hostname"

-- 
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/d4786703-5799-4d89-b2a4-3cbec0237a65%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to