| OLD | NEW |
| (Empty) |
| 1 # == Type: adblockplus::host::statsmaster | |
| 2 # | |
| 3 # Nagios definitions for any host recognized, included automatically with type | |
| 4 # adblockplus::host if the current node's $::role is 'statsmaster'. | |
| 5 # | |
| 6 define adblockplus::host::statsmaster { | |
| 7 | |
| 8 $ensure = getparam(Adblockplus::Host[$title], 'ensure') | |
| 9 $role = getparam(Adblockplus::Host[$title], 'role') | |
| 10 | |
| 11 realize(Host[$title]) | |
| 12 realize(Sshkey[$title]) | |
| 13 | |
| 14 if $ensure == 'present' { | |
| 15 | |
| 16 include sitescripts | |
| 17 $fqdn = getparam(Adblockplus::Host[$title], 'fqdn') | |
| 18 | |
| 19 # https://issues.adblockplus.org/ticket/3638#comment:17 | |
| 20 if $role == 'filterserver' { | |
| 21 | |
| 22 sitescripts::configfragment {"mirror#$title": | |
| 23 content => join([ | |
| 24 "# Filter mirror $fqdn", | |
| 25 "mirror_$name=subscription ssh://stats@$fqdn/access_log_easylist_downl
oads.1.gz", | |
| 26 "mirror_n_$name=notification ssh://stats@$fqdn/access_log_notification
.1.gz", | |
| 27 "" | |
| 28 ], "\n"), | |
| 29 } | |
| 30 } | |
| 31 | |
| 32 # https://issues.adblockplus.org/ticket/4728 | |
| 33 if $role == 'downloadserver' { | |
| 34 | |
| 35 sitescripts::configfragment {"mirror#$title": | |
| 36 content => join([ | |
| 37 "# Download mirror $fqdn", | |
| 38 "mirror_$name=download ssh://stats@$fqdn/access_log_downloads.1.gz", | |
| 39 "" | |
| 40 ], "\n"), | |
| 41 } | |
| 42 } | |
| 43 elsif $role == 'updateserver' { | |
| 44 | |
| 45 sitescripts::configfragment {"mirror#$title": | |
| 46 content => join([ | |
| 47 "# Update mirror $fqdn", | |
| 48 "mirror_$name=update ssh://stats@$fqdn/access_log_update.1.gz", | |
| 49 "" | |
| 50 ], "\n"), | |
| 51 } | |
| 52 } | |
| 53 } | |
| 54 } | |
| OLD | NEW |