Hello ansible folk,
I have a custom role called "firewall" that I currently use with CentOS 6.
It managed the ip(6)tables rules files and reloads iptables as needed.
Now I have a CentOS 7 server, on which firewalling is done by firewalld, so
all my tasks and handlers and everything has to change. I was looking for a
way to use the same role to work with both CentOS 6 and 7. I wanted to have:
roles/
firewall/
tasks/
main.yml
CentOS6.yml
CentOS7.yml
And then in main.yml, have something like:
- include:
'{{ansible_distribution}}{{ansible_distribution_major_version}}.yml'
However, this is not allowed, as I discovered in the documentation.
Is there any way I can keep a single role, and make it work simply with
both OS versions?
Regards,
Anand
--
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/da305d8a-2ced-4df6-ac87-65ccc43536aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.