Ask Your Question
1

Using Wildcards in Hiera.yaml

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

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
1

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

adrianlzt gravatar image
edit flag offensive delete link more
0

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

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.

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

Comments

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

Ancillas gravatar imageAncillas ( 2013-04-30 10:45:48 -0500 )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

Stats

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

Seen: 2,357 times

Last updated: Dec 26 '13