geerlingguy / ansible-role-firewall

Ansible Role - iptables Firewall configuration.
https://galaxy.ansible.com/geerlingguy/firewall/
MIT License
524 stars 217 forks source link

Use ansible_port if defined instead of always 22 #76

Closed nununo closed 3 years ago

nununo commented 4 years ago

Hello,

This is currently the default:

firewall_allowed_tcp_ports:
  - "22"
  - "25"
  - "80"
  - "443"

Whenever ansible_port is not 22... this variable must be redefined. Wouldn't it be more flexible to have something like?:

firewall_allowed_tcp_ports:
  - "'{% if ansible_port is defined %}{{ ansible_port }}{% else %}22{% endif %}'"
  - "25"
  - "80"
  - "443"

I'm not sure the jinja2 syntax is correct but the idea is there.

Let me know if this is considered a good idea so I can implement it a issue a PR.

Thanks!

stale[bot] commented 3 years ago

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

stale[bot] commented 3 years ago

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.