Ask Your Question
0

Trigger hostnames

asked 2016-03-30 11:16:06 -0500

MoP gravatar image

Hello all,

I did currently setup a full puppet architecture with a master and some nodes... (classic...)

My site.pp looks like that :

node default { include plopinfracommon include plopcommonuser include plopcommonuser::lse

sudo (make me a sandwich)

include plopcommonsudo }

##### Server1

node /^plop-distr3-dev/ { include plopinfracommon include plopcommonuser include plopcommonuser::lse

sudo (make me a sandwich)

include plopcommonsudo }

##### Server1

node /^plop-distr3-dev/ { include plopinfrainstaller ... ...

My question is very simple, how can i simplify that ?... since the hostnames are mostly the same except the digit in the middle. I do not know how to organize that when there is a digit in the mid of the hostname. I know how to deal with the digit in the end of it : I can trigger them in that way (it works for me) : node /^plop-distr-dev\d+$/ {

if these hostnames were would be like plop-distr-dev1-2-3 and so on.... but it is not the case... Any advice ?

Cheers and thank you in advance !

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2016-03-30 18:47:01 -0500

Regex isn't my strongest subject but I thought I'd give it a go. Practice makes perfect right? I think this would do it but I'm not able to test it myself right this second.

/^plop-distr(\d+)-dev/

edit flag offensive delete link more
0

answered 2016-03-31 02:07:21 -0500

MoP gravatar image

updated 2016-04-25 06:08:03 -0500

Works ! thanks a lot.

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-03-30 11:16:06 -0500

Seen: 46 times

Last updated: Apr 25 '16