using ip range in default.pp

22 views
Skip to first unread message

saha...@gmail.com

unread,
Nov 24, 2015, 11:18:33 AM11/24/15
to Puppet Users
Hello All, 

i am trying to use a range of ip address in below manner. the ip address ranges are 10.167.26.x, 10.167.25.x,10.167.5.x and 10.167.6.x
when i use the below it doesnt work.

please help!

Thanks,
Sara 

 if $::ipaddress =~ /^10\.0\.167\.\d{1,2}\.\d{1,3}$/ {
        include user::groups
        include user::sysadmin
        include sudoers
        include user::dev
  }

Peter Kristolaitis

unread,
Nov 24, 2015, 11:20:30 AM11/24/15
to puppet...@googlegroups.com
You have an extra octet in the regex.

That regex would match "10.0.167.xx.yyy". Take out the "0\." after the
"10\.".

saha...@gmail.com

unread,
Nov 24, 2015, 12:58:54 PM11/24/15
to Puppet Users
Hi Peter, 

Thank you very much! it was right on my face. I can not believe i was looking at it and couldn't see it!

Thanks again
Sara
Reply all
Reply to author
Forward
0 new messages