Ask Your Question
1

How can I use a regex in the confine statement of a custom fact?

asked 2014-03-31 10:11:14 -0500

kidrock gravatar image

I am trying to confine a custom fact to a specific set of hostnames using a confine statement (maybe not the best way to do this, but I would like to see it work anyway). The syntax I've tried is this:

confine :hostname => "/brmke\w{3}ifsap/"

The confine statement is being ignored altogether and the logic in setcode is being executed everywhere. Is there a way to accomplish what I'm trying to do here?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2014-03-31 11:57:05 -0500

lavaman gravatar image

Anything in quotes is a string. Try removing the double quotes so ruby sees it as a regex.

edit flag offensive delete link more

Comments

Ah, that was it. Thanks!

kidrock gravatar imagekidrock ( 2014-03-31 12:21:56 -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

1 follower

Stats

Asked: 2014-03-31 10:11:14 -0500

Seen: 769 times

Last updated: Jun 26 '14