--- - import_playbook: enable_epel.yml - hosts: all gather_facts: false become: true strategy: free tasks: #RHEL based OS version 7 stuff - name: Packages major_version 7 when: ansible_facts['distribution_major_version'] == "7" package: name: ['nmap-ncat', 'curl', 'rsync', 'sysstat', 'bind-utils', 'wget', 'bash-completion', 'mlocate', 'lsof', 'htop', 'sharutils', 'python2-psutil', 'yum-utils', 'ps_mem' ] state: present #RHEL based OS version 6 stuff - name: Packages major_version 6 when: ansible_facts['distribution_major_version'] == "6" package: name: ['nc', 'curl', 'rsync', 'sysstat', 'bind-utils', 'wget', 'bash-completion', 'libselinux-python', 'lsof' ] state: present