Skip to content

Commit

Permalink
Fix for Fedora (python3).
Browse files Browse the repository at this point in the history
  • Loading branch information
robertdebock committed Oct 10, 2018
1 parent ba8b4a9 commit da5abb2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 0 additions & 2 deletions molecule/centos-latest/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ platforms:
image: centos:latest
provisioner:
name: ansible
extra_vars:
ansible_python_interpreter: /usr/bin/python3
lint:
name: ansible-lint
scenario:
Expand Down
11 changes: 9 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
---
# tasks file for firewall
- name: use configured python version
set_fact:
ansible_python_interpreter: "{{ firewall_ansible_python_interpreter[ansible_distribution ~ '-' ~ ansible_distribution_major_version]
|default(firewall_ansible_python_interpreter[ansible_distribution]
|default(firewall_ansible_python_interpreter['default'])) }}"

- name: remove conflicting software
package:
name: "{{ firewall_packages['conflicting'][ansible_distribution]
Expand Down Expand Up @@ -80,8 +86,9 @@
- name: configure iptables
template:
src: iptables.j2
dest: "{{ firewall_iptables_rulefile[ansible_distribution]
| default(firewall_iptables_rulefile['default'] }}"
dest: "{{ firewall_iptables_rulefile[ansible_distribution ~ '-' ~ ansible_distribution_major_version]
| default(firewall_iptables_rulefile[ansible_distribution]
| default(firewall_iptables_rulefile['default'])) }}"
validate: "iptables-restore --test %s"
when:
- ansible_virtualization_type != "docker"
Expand Down
5 changes: 5 additions & 0 deletions vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
---
# vars file for firewall
firewall_ansible_python_interpreter:
default: /usr/bin/python
Fedora: /usr/bin/python3

firewall_packages:
required:
default:
Expand All @@ -14,6 +18,7 @@ firewall_packages:
- iptables-services
Fedora:
- firewalld
- python3-firewall
openSUSE Leap:
- firewalld
openSUSE Tumbleweed:
Expand Down

0 comments on commit da5abb2

Please sign in to comment.