And when I did this:
---
- name: Gathering the local facts from tags
hosts: all
gather_facts: yes
roles:
- facts
- include: base_centos7.yml
when: ansible_distribution_major_version == '7'
I got a different error:
ERROR! Invalid role definition: None
On Thursday, February 23, 2017 at 11:39:31 AM UTC-8, Steven Truong wrote:
>
> Hi all,
>
> 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.
>
--
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/c120de93-c7af-4576-95ec-17616da5b37c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.