debops / ansible-ferm

Manage iptables firewall using ferm
GNU General Public License v3.0
32 stars 20 forks source link

It does not create a rules file #73

Closed le9i0nx closed 8 years ago

le9i0nx commented 8 years ago

I created a role in it I need to configure the firewall. https://github.com/le9i0nx/ansible-root/blob/master/service/avachi.yml https://github.com/le9i0nx/ansible-avahi/blob/master/defaults/main.yml#L12

I took your code for example here https://github.com/debops/debops-playbooks/blob/master/playbooks/service/postfix.yml#L9 https://github.com/debops/ansible-postfix/blob/master/defaults/main.yml#L537 and https://github.com/debops/debops-playbooks/blob/master/playbooks/service/nginx.yml#L14 https://github.com/debops/ansible-nginx/blob/master/defaults/main.yml#L431 and https://github.com/debops/debops-playbooks/blob/master/playbooks/service/sshd.yml#L14 https://github.com/debops/ansible-sshd/blob/master/defaults/main.yml#L555

I do not see what is missing in my version to the file created

le9i0nx commented 8 years ago

excuse was inattentive when copying rules https://github.com/le9i0nx/ansible-avahi/blob/master/defaults/main.yml#L16 usually incorrectly identified

le9i0nx commented 8 years ago

https://github.com/le9i0nx/ansible-avahi/blob/5cc85456de580103128ebf1719bed1fdbc13cb03/defaults/main.yml#L16 Maybe you need to add termination with an error if the value of this variable is definitely not.

avachi_ferm_dependent_rules:

  - type: 'accept'
    dport: '{{ avachi_ferm_ports }}'
    weight: '{{ sshd_ferm_weight }}'    <-------
    protocol: 'tcp'
    role: 'avachi'
    name: 'mdns'
    multiport: True
    accept_any: True

because if it is empty then nothing is done

drybjed commented 8 years ago

The item.weight parameter is optional and lets you tell the debops.ferm role where in the iptables chain your role should be inserted (roughly). There is a default, and you shouldn't need this parameter for your role.

le9i0nx commented 8 years ago

Yes it's good.