Ask Your Question

Using Wildcards in Hiera.yaml

asked 2013-04-30 07:52:49 -0600

d9705996 gravatar image

I am using Puppet Open Source v3.0.2 using Hiera for storing node details.

I have a proxy module at the moment that creates the required iptables rules for the server so that each client has their own data port that redirects to the same port i.e.

iptables {"8100: Client A Prerouting": chain => 'PREROUTING', table => "nat", dport => 8100, proto => 'tcp', jump => 'DNAT', todest => 4130}
iptables {"8101: Client B Prerouting": chain => 'PREROUTING', table => "nat", dport => 8101, proto => 'tcp', jump => 'DNAT', todest => 4130}

All of which works well but as the number of clients grows this file is going to ... (more)

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2013-12-26 01:46:11 -0600

adrianlzt gravatar image
edit flag offensive delete link more

answered 2013-04-30 10:45:10 -0600

Ancillas gravatar image

No, but you could use a variable with the string. In this example, all of your rules would be under the iptables directory.

  - iptables/%{dport}
edit flag offensive delete link more


You'll have to make sure that $dport is within Hiera's scope.

Ancillas gravatar imageAncillas ( 2013-04-30 10:45:48 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-04-30 07:52:49 -0600

Seen: 2,781 times

Last updated: Dec 26 '13