|
|
@ -1,18 +1,18 @@ |
|
|
|
--- |
|
|
|
- name: 'set port redirection rule for {{ rule_name }}' |
|
|
|
- name: 'set port redirection rule for {{ pf_rule_name }}' |
|
|
|
uci: |
|
|
|
command: 'set' |
|
|
|
key: 'firewall.{{ item.0 }}' |
|
|
|
value: '{{ item.1 }}' |
|
|
|
loop: |
|
|
|
- [ '{{ rule_name }}', 'redirect' ] |
|
|
|
- [ '{{ rule_name }}.name', 'AnsibleManagedRedirect: {{ rule_name }}' ] |
|
|
|
- [ '{{ rule_name }}.proto', '{{ proto }}' ] |
|
|
|
- [ '{{ rule_name }}.src', 'wan' ] |
|
|
|
- [ '{{ rule_name }}.dest', 'secure' ] |
|
|
|
- [ '{{ rule_name }}.src_dport', '{{ port }}' ] |
|
|
|
- [ '{{ rule_name }}.dest_ip','{{ hostvars | ip_from_inventory(inventory_hostname) }}' ] |
|
|
|
- [ '{{ rule_name }}.dest_port', '{{ int_port | default(port) }}' ] |
|
|
|
- [ '{{ pf_rule_name }}', 'redirect' ] |
|
|
|
- [ '{{ pf_rule_name }}.name', 'AnsibleManagedRedirect: {{ pf_rule_name }}' ] |
|
|
|
- [ '{{ pf_rule_name }}.proto', '{{ pf_proto }}' ] |
|
|
|
- [ '{{ pf_rule_name }}.src', 'wan' ] |
|
|
|
- [ '{{ pf_rule_name }}.dest', 'secure' ] |
|
|
|
- [ '{{ pf_rule_name }}.src_dport', '{{ pf_port }}' ] |
|
|
|
- [ '{{ pf_rule_name }}.dest_ip','{{ hostvars | ip_from_inventory(inventory_hostname) }}' ] |
|
|
|
- [ '{{ pf_rule_name }}.dest_port', '{{ pf_int_port | default(pf_port) }}' ] |
|
|
|
delegate_to: '{{ firewall }}' |
|
|
|
notify: |
|
|
|
- 'uci commit firewall' |
|
|
|