Puppet Function: logrotate::find_match
- Defined in:
- functions/find_match.pp
- Function type:
- Puppet Language
Summary
convert the passed string to a regex to search withOverview
Figure out the regexp we need to use with ‘fm_replace` in order to update the passed in setting
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'functions/find_match.pp', line 11
function logrotate::find_match($setting) >> String {
case $setting {
"daily", "weekly", "monthly", "yearly": {
$match = "^(daily|weekly|monthly|yearly)"
}
"rotate": {
$match = "^rotate"
}
default: {
# strip any 'no' from setting
$setting_stripped = regsubst($setting, '^(no)?(.+)', '\2')
$match = "^(no)?${setting_stripped}"
}
}
$match
}
|