---
- hosts: all
vars:
rhel5: true
when:
ansible_os_family == "RedHat" and
ansible_distribution_major_version == "5"
rhel6: true
when:
ansible_os_family == "RedHat" and
ansible_distribution_major_version == "6"
tasks:
- name: Just debugging
copy: src=/etc/hosts dest=/tmp/test
when: rhel5 or rhel6
--
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-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/dbf1f453-be5f-411b-b028-2c49316a45cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
---- hosts: all
vars:
rhel5: '{{ ansible_os_family == "RedHat" and ansible_distribution_major_version == "5" }}' rhel6: '{{ ansible_os_family == "RedHat" and ansible_distribution_major_version == "6" }}' rhel7: '{{ ansible_os_family == "RedHat" and ansible_distribution_major_version == "7" }}'
tasks:
- name: Just debugging copy: src=/etc/hosts dest=/tmp/test when: rhel5 or rhel6