Browse Source

roles/port_forwarding: add prefix to var names

python3
Zolfa 4 years ago
parent
commit
c112650dc2
Signed by: zolfa GPG Key ID: E1A43B038C4D6616
1 changed files with 9 additions and 9 deletions
  1. +9
    -9
      roles/port_forwarding/tasks/main.yaml

+ 9
- 9
roles/port_forwarding/tasks/main.yaml View File

@ -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'


Loading…
Cancel
Save