I have an Ansible playbook that I want to load custom variables for. I do 
not have access to the inventory but I wish to classify the variables by 
their host names which can be classified in groups. The jobs would be fired 
from Ansible Tower. Where should I put these variables such that they by 
default override the values in tower? I've tried putting them in the vars 
file in the role that's supposed to run but the operation occurs as per the 
values in tower. I've tried putting them in the main play as well but it 
returns an error "<<vars file>> should be a list or None."

-  name: manage services
   hosts: all
   tasks:
   include_vars:
     - "{{playbook_dir}}/../roles/service_management/vars/s1s2grouping.yml"

A little test in the role shows that the file is being loaded.


- name: include variables
  include_vars:
    file: s1s2grouping.yml
  register: checking

- debug: "msg={{checking.ansible_included_var_files}}"

The above code results in a positive answer.

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/4cfcb51a-17ad-4c00-a972-9ecf4598d5eb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to