Merge "Add check for string type dport"

This commit is contained in:
Zuul 2019-08-27 22:48:19 +00:00 committed by Gerrit Code Review
commit 2258e27828
3 changed files with 6 additions and 6 deletions

View File

@ -22,11 +22,11 @@
tripleo_firewall_rules: tripleo_firewall_rules:
'003 accept ftp from all': '003 accept ftp from all':
proto: 'tcp' proto: 'tcp'
dport: 21 dport: "21"
'003 accept custom from all': '003 accept custom from all':
proto: 'udp' proto: 'udp'
dport: dport:
- 2121 - "2121"
- 2122 - 2122
- 2123 - 2123
- 2200-2210 - 2200-2210

View File

@ -22,13 +22,13 @@
tripleo_firewall_rules: tripleo_firewall_rules:
'003 accept ftp from all': '003 accept ftp from all':
proto: 'tcp' proto: 'tcp'
dport: 21 dport: "21"
extras: extras:
ensure: 'absent' ensure: 'absent'
'003 accept custom from all': '003 accept custom from all':
proto: 'udp' proto: 'udp'
dport: dport:
- 2121 - "2121"
- 2122 - 2122
- 2123 - 2123
- 2200-2210 - 2200-2210

View File

@ -60,7 +60,7 @@
when: when:
- (item['rule']['proto'] | default('tcp')) != 'ipv6' - (item['rule']['proto'] | default('tcp')) != 'ipv6'
- item['rule']['source'] | default('127.0.0.1') | ipv4 - item['rule']['source'] | default('127.0.0.1') | ipv4
loop: "{{ (item['rule']['dport'] is iterable) | ternary(item['rule']['dport'], [item['rule']['dport']]) }}" loop: "{{ ((item['rule']['dport'] is iterable) and (item['rule']['dport'] is not string)) | ternary(item['rule']['dport'], [item['rule']['dport']]) }}"
loop_control: loop_control:
loop_var: port loop_var: port
notify: notify:
@ -83,7 +83,7 @@
when: when:
- (item['rule']['proto'] | default('tcp')) != 'ipv4' - (item['rule']['proto'] | default('tcp')) != 'ipv4'
- item['rule']['source'] | default('::') | ipv6 - item['rule']['source'] | default('::') | ipv6
loop: "{{ (item['rule']['dport'] is iterable) | ternary(item['rule']['dport'], [item['rule']['dport']]) }}" loop: "{{ ((item['rule']['dport'] is iterable) and (item['rule']['dport'] is not string)) | ternary(item['rule']['dport'], [item['rule']['dport']]) }}"
loop_control: loop_control:
loop_var: port loop_var: port
notify: notify: