These are what I am trying:
base-ng.yml:
---
- name: Gathering the local facts from tags
hosts: all
gather_facts: yes
roles:
- facts
- include: "base_centos{{ ansible_distribution_major_version }}.yml"
-----
base_centos7.yml:
---
- hosts: all
gather_facts: no
roles:
- { role: common, tags: ["base"] }
-----
ansible-playbook base-ng.yml -i "54.200.xx.xx," --private-key ~/.ssh/dev.pem -u ec2-user -b -vvvvv
Using /home/steven/ansible/ansible.cfg as config file
statically included: /home/steven/ansible/roles/facts/tasks/pax_tags.yml
ERROR! 'ansible_distribution_major_version' is undefined
Did I do something wrong? I am confused.
Thanks.