---
- name: Ensure iptables service is installed
  yum: name=iptables-services state=present

- name: Ensure iptables service is enabled & started
  service: name=iptables enabled=yes state=started

---
- name: Ensure iptables service is installed
  yum: name=iptables-services state=present
  when: ansible_distribution_major_version >= '7'

- name: Ensure iptables service is installed
  yum: name=iptables state=present
  when: ansible_distribution_major_version < '7'

- name: Ensure iptables service is enabled & started
  service: name=iptables enabled=yes state=started

Add support for rhel/centos < 7
Add support for rhel/centos < 7

In at least rhel/centos 6 the package providing iptables is called "iptables"