You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
---
- hosts: localhostbecome: truetasks:
- name: reset ufwcommunity.general.ufw:
state: reset
- name: | allow ssh at position 1 forget about the reset in the previous task. theoretically I want to add this rule at any state of ufw. community.general.ufw: rule: allow src: 0.0.0.0/0 from_port: 22 proto: tcp insert: 1
Expected Results
No errors.
root@ubuntu-4gb-nbg1-2:~# ufw status numbered
Status: active
To Action From
-- ------ ----
[ 1] 22/tcp ALLOW IN Anywhere
Actual Results
TASK [reset ufw] *****************************************************************************************************************************************changed: [localhost]TASK [allow ssh at position 1forget about the reset in theprevious task.theoretically I want to add thisrule at any state of ufw.] ***********************fatal: [localhost]: FAILED! => {"changed": false, "commands": ["/usr/sbin/ufw status verbose", "/usr/bin/grep -h '^### tuple' /lib/ufw/user.rules /lib/ufw/user6.rules /etc/ufw/user.rules /etc/ufw/user6.rules /var/lib/ufw/user.rules /var/lib/ufw/user6.rules", "/usr/sbin/ufw --version", "/usr/sbin/ufw insert 1 allow from 0.0.0.0/0 port 22 to any proto tcp"], "msg": "ERROR: Invalid position '1'\n"}
Code of Conduct
I agree to follow the Ansible Code of Conduct
The text was updated successfully, but these errors were encountered:
Summary
The
insert
parameter does not work in many ways.tabula rasa ufw and insert 1
When ufw is resetted and empty, it's simply not possible to insert a rule at position 1.
The ansible ufw module must handle this as an abstration layer.
it's impossible to insert IPv6 rules before IPv4 or numbered in general
I've no idea how to handle this....
Issue Type
Bug Report
Component Name
community.general.ufw
Ansible Version
Community.general Version
Configuration
OS / Environment
Arch Linux
Steps to Reproduce
Expected Results
No errors.
Actual Results
Code of Conduct
The text was updated successfully, but these errors were encountered: