Hi all,

I cannot use facts for include variables. I think it's because the yaml 
syntax checker fails (as they don't exits at that time):

My test play:
---
- hosts: localhost
  gather_facts: true
  tasks:
  - include: 
"{{ansible_distribution}}{{ansible_distribution_major_version}}.yml"

$ansible-playbook -i hosts -l localhost -C playbooks/test.yml 
ERROR: file could not read: 
/home/heinzoliver/ansible/branches/heinzoliver/playbooks/{{ansible_distribution}}{{ansible_distribution_major_version}}.yml

=> it should be 
/home/heinzoliver/ansible/branches/heinzoliver/playbooks/Debian7.yml

My goal is to put the tasks that differ between the distiributions in 
seperate task files to avoid having lot's of when-clauses or completely 
seperated roles for things that are 90% the same and differ 10% between 
dists/dist-versions.
Is there any chance that the facts can be gathered before doing the rest of 
the syntax checking? Is it possible to disable the checks? Or am I'm on the 
wrong track at all?

TIA,
Oliver






-- 
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/31ff684a-330a-4c05-99ba-d49c73a0b8af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to