Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings for ufw examples #63505

Merged
merged 1 commit into from
Oct 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 9 additions & 9 deletions lib/ansible/modules/system/ufw.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@

- name: Set logging
ufw:
logging: on
logging: 'on'

# Sometimes it is desirable to let the sender know when traffic is
# being denied, rather than simply ignoring it. In these cases, use
Expand Down Expand Up @@ -185,7 +185,7 @@
- name: Deny all access to port 53
ufw:
rule: deny
port: 53
port: '53'

- name: Allow port range 60000-61000
ufw:
Expand All @@ -196,7 +196,7 @@
- name: Allow all access to tcp port 80
ufw:
rule: allow
port: 80
port: '80'
proto: tcp

- name: Allow all access from RFC1918 networks to this host
Expand All @@ -213,7 +213,7 @@
rule: deny
proto: udp
src: 1.2.3.4
port: 514
port: '514'
comment: Block syslog

- name: Allow incoming access to eth0 from 1.2.3.5 port 5469 to 1.2.3.4 port 5469
Expand All @@ -223,24 +223,24 @@
direction: in
proto: udp
src: 1.2.3.5
from_port: 5469
from_port: '5469'
dest: 1.2.3.4
to_port: 5469
to_port: '5469'

# Note that IPv6 must be enabled in /etc/default/ufw for IPv6 firewalling to work.
- name: Deny all traffic from the IPv6 2001:db8::/32 to tcp port 25 on this host
ufw:
rule: deny
proto: tcp
src: 2001:db8::/32
port: 25
port: '25'

- name: Deny all IPv6 traffic to tcp port 20 on this host
# this should be the first IPv6 rule
ufw:
rule: deny
proto: tcp
port: 20
port: '20'
to_ip: "::"
insert: 0
insert_relative_to: first-ipv6
Expand All @@ -254,7 +254,7 @@
ufw:
rule: deny
proto: tcp
port: 20
port: '20'
to_ip: "::"
insert: -1
insert_relative_to: last-ipv4
Expand Down