| OLD | NEW |
| 1 # == Type: adblockplus::host::statsmaster | 1 # == Type: adblockplus::host::statsmaster |
| 2 # | 2 # |
| 3 # Nagios definitions for any host recognized, included automatically with type | 3 # Nagios definitions for any host recognized, included automatically with type |
| 4 # adblockplus::host if the current node's $::role is 'statsmaster'. | 4 # adblockplus::host if the current node's $::role is 'statsmaster'. |
| 5 # | 5 # |
| 6 define adblockplus::host::statsmaster { | 6 define adblockplus::host::statsmaster { |
| 7 | 7 |
| 8 $ensure = getparam(Adblockplus::Host[$title], 'ensure') | 8 $ensure = getparam(Adblockplus::Host[$title], 'ensure') |
| 9 $role = getparam(Adblockplus::Host[$title], 'role') | 9 $role = getparam(Adblockplus::Host[$title], 'role') |
| 10 | 10 |
| 11 realize(Host[$title]) | 11 realize(Host[$title]) |
| 12 realize(Sshkey[$title]) | 12 realize(Sshkey[$title]) |
| 13 | 13 |
| 14 # https://issues.adblockplus.org/ticket/3638#comment:17 | 14 if $ensure == 'present' { |
| 15 if ($role == 'filterserver') and ($ensure == 'present') { | |
| 16 | 15 |
| 17 include sitescripts | 16 include sitescripts |
| 18 $fqdn = getparam(Adblockplus::Host[$title], 'fqdn') | 17 $fqdn = getparam(Adblockplus::Host[$title], 'fqdn') |
| 19 | 18 |
| 20 sitescripts::configfragment {"mirror#$title": | 19 # https://issues.adblockplus.org/ticket/3638#comment:17 |
| 21 content => join([ | 20 if $role == 'filterserver' { |
| 22 "# Filter mirror $fqdn", | 21 |
| 23 "mirror_$name=subscription ssh://stats@$fqdn/access_log_easylist_downloa
ds.1.gz", | 22 sitescripts::configfragment {"mirror#$title": |
| 24 "mirror_n_$name=notification ssh://stats@$fqdn/access_log_notification.1
.gz", | 23 content => join([ |
| 25 "" | 24 "# Filter mirror $fqdn", |
| 26 ], "\n"), | 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 } |
| 27 } | 52 } |
| 28 } | 53 } |
| 29 } | 54 } |
| OLD | NEW |