Skip to content
This repository was archived by the owner on Feb 13, 2023. It is now read-only.

Commit f6fcbd1

Browse files
committed
Update Firewall role so Ubuntu 16.04 doesn't complain when ufw isn't installed.
1 parent 5e44eb6 commit f6fcbd1

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

provisioning/requirements.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
- src: geerlingguy.elasticsearch
2727
version: 2.1.3
2828
- src: geerlingguy.firewall
29-
version: 2.2.0
29+
version: 2.2.1
3030
- src: geerlingguy.git
3131
version: 1.3.0
3232
- src: geerlingguy.java

provisioning/roles/geerlingguy.firewall/tasks/disable-other-firewalls.yml

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
2-
- name: Check firewalld package is installed (on RHEL).
2+
- name: Check if firewalld package is installed (on RHEL).
33
shell: yum list installed firewalld
4+
args:
5+
warn: no
46
register: firewalld_installed
57
ignore_errors: true
68
changed_when: false
@@ -13,8 +15,10 @@
1315
enabled: no
1416
when: ansible_os_family == "RedHat" and firewall_disable_firewalld and firewalld_installed.rc == 0
1517

16-
- name: Check ufw package is installed (on Ubuntu).
17-
shell: dpkg -l ufw
18+
- name: Check if ufw package is installed (on Ubuntu).
19+
shell: service ufw status
20+
args:
21+
warn: no
1822
register: ufw_installed
1923
ignore_errors: true
2024
changed_when: false
@@ -27,8 +31,10 @@
2731
enabled: no
2832
when: ansible_distribution == "Ubuntu" and firewall_disable_ufw and ufw_installed.rc == 0
2933

30-
- name: Check ufw package is installed (on Archlinux).
34+
- name: Check if ufw package is installed (on Archlinux).
3135
command: pacman -Q ufw
36+
args:
37+
warn: no
3238
register: ufw_installed
3339
ignore_errors: true
3440
changed_when: false

provisioning/roles/geerlingguy.firewall/templates/firewall.bash.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# 22: SSH
99
# 25: SMTP
1010
# 80: HTTP
11-
# 123: DNS
11+
# 123: NTP
1212
# 443: HTTPS
1313
# 2222: SSH alternate
1414
# 4949: Munin

0 commit comments

Comments
 (0)