-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathhost-excludes.pp
36 lines (30 loc) · 1.23 KB
/
host-excludes.pp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# here is an example of how to use host excludes:
class { '::ipa::server':
shorewall => true,
host_excludes => [
"'foo-42.example.com'", # exact string match
'"foo-bar.example.com"', # exact string match
'^[a-z0-9-]*\\-foo\\.example\\.com$', # *-foo.example.com or:
'^[[:alpha:]]{1}[[:alnum:]-]*\\-foo\\.example\\.com$',
'^foo\\-[0-9]{1,}\\.example\\.com' # foo-<\d>.example.com
],
}
# you'll see that you need double \\ to escape out the one we want in the match
# if you just want to match most sane domain strings and avoid auto deletion:
class { '::ipa::server':
shorewall => true,
host_excludes => true, # automatically chooses a match all pattern
}
# please remember that *any* match in the list will exclude a host deletion
# if you prefer to specify only one match, a single string will work too...
# if you want to be more dynamic, you can use something like:
$match_domain = regsubst($domain, '\.', '\\.', 'G')
class { '::ipa::server':
domain => $domain,
shorewall => true,
host_excludes => [
"^test[0-9]{1,}\\.${match_domain}\$", # test\d.domain
],
}
# i found some notes on available bracket expressions here:
# http://www.regular-expressions.info/posixbrackets.html