Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
arusso opened this issue Aug 27, 2014 · 0 comments
Open

Comments

@arusso
Copy link
Contributor

arusso commented Aug 27, 2014

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')}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant