Skip to content

comma-separated lists within arrays do not work with split_ip_by_version #20

@arusso

Description

@arusso

Providing the following input to split_ip_by_version, you'll get all failures.

$input = [ '10.0.0.0/8,192.168.0.0/24', '172.16.0.0/12' ]
$output = split_ip_by_version($input)
size($output['other']) # == 1
size($output['4']) # == 1
size($output['6']) # == 1

We should be smart enough to break up the the lists, much like we flatten embedded arrays.

This comes up in hiera, when we do something like:


---
some_network: '10.0.0.0/8'
our_networks: '192.168.0.0/24,'172.16.0.0/12'

profile::firewall::rules:
  'some rule':
    protocol: tcp
    source:
      - "%{hiera('some_network')}"
      - "%{hiera('our_networks')}"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions