Skip to content

Commit

Permalink
Merge pull request #23 from nspcc-dev/ferm-fix
Browse files Browse the repository at this point in the history
use ansible.utils.network_in_usable for ip check
  • Loading branch information
532910 authored Sep 25, 2024
2 parents 2afbc57 + 27b3a7d commit 7f284fa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ neogo__ferm__dependent_rules:
saddr: '{{ neogo__rpc_allow + neogo__rpc_group_allow + neogo__rpc_host_allow }}'
protocol: 'tcp'
role: 'neogo-legacy'
rule_state: "{{ 'present' if neogo__rpc_enabled and neogo__rpc_address not in ['localhost', '127.0.0.1', '::1'] else 'absent' }}"
rule_state: "{{ 'present' if neogo__rpc_enabled and not ( neogo__rpc_address == 'localhost' or '127.0.0.0/8'|ansible.utils.network_in_usable( neogo__rpc_address ) or '::1/128'|ansible.utils.network_in_usable( neogo__rpc_address ) ) else 'absent' }}"

- type: 'accept'
name: 'neogo{{ neogo__instance }}_tls'
Expand All @@ -189,7 +189,7 @@ neogo__ferm__dependent_rules:
saddr: '{{ neogo__rpc_allow + neogo__rpc_group_allow + neogo__rpc_host_allow }}'
protocol: 'tcp'
role: 'neogo-legacy'
rule_state: "{{ 'present' if neogo__tls_enabled and neogo__tls_address not in ['localhost', '127.0.0.1', '::1'] else 'absent' }}"
rule_state: "{{ 'present' if neogo__tls_enabled and not ( neogo__tls_address == 'localhost' or '127.0.0.0/8'|ansible.utils.network_in_usable( neogo__tls_address ) or '::1/128'|ansible.utils.network_in_usable( neogo__tls_address ) ) else 'absent' }}"

- type: 'accept'
name: 'neogo{{ neogo__instance }}_metrics'
Expand All @@ -198,7 +198,7 @@ neogo__ferm__dependent_rules:
saddr: '{{ neogo__metrics_allow + neogo__metrics_group_allow + neogo__metrics_host_allow }}'
protocol: 'tcp'
role: 'neogo-legacy'
rule_state: "{{ 'present' if neogo__metrics_enabled and neogo__metrics_address not in ['localhost', '127.0.0.1', '::1'] else 'absent' }}"
rule_state: "{{ 'present' if neogo__metrics_enabled and not ( neogo__metrics_address == 'localhost' or '127.0.0.0/8'|ansible.utils.network_in_usable( neogo__metrics_address ) or '::1/128'|ansible.utils.network_in_usable( neogo__metrics_address ) ) else 'absent' }}"

- type: 'accept'
name: 'neogo{{ neogo__instance }}_pprof'
Expand All @@ -207,4 +207,4 @@ neogo__ferm__dependent_rules:
saddr: '{{ neogo__pprof_allow + neogo__pprof_group_allow + neogo__pprof_host_allow }}'
protocol: 'tcp'
role: 'neogo-legacy'
rule_state: "{{ 'present' if neogo__pprof_enabled and neogo__pprof_address not in ['localhost', '127.0.0.1', '::1'] else 'absent' }}"
rule_state: "{{ 'present' if neogo__pprof_enabled and not ( neogo__pprof_address == 'localhost' or '127.0.0.0/8'|ansible.utils.network_in_usable( neogo__pprof_address ) or '::1/128'|ansible.utils.network_in_usable( neogo__pprof_address ) ) else 'absent' }}"

0 comments on commit 7f284fa

Please sign in to comment.