Changeset View
Changeset View
Standalone View
Standalone View
site-modules/profile/manifests/swh/deploy/graph.pp
Show All 12 Lines | class profile::swh::deploy::graph { | ||||
$group = lookup('swh::deploy::graph::group') | $group = lookup('swh::deploy::graph::group') | ||||
$sentry_dsn = lookup("swh::deploy::graph::sentry_dsn", Optional[String], 'first', undef) | $sentry_dsn = lookup("swh::deploy::graph::sentry_dsn", Optional[String], 'first', undef) | ||||
$sentry_environment = lookup("swh::deploy::graph::sentry_environment", Optional[String], 'first', undef) | $sentry_environment = lookup("swh::deploy::graph::sentry_environment", Optional[String], 'first', undef) | ||||
$sentry_swh_package = lookup("swh::deploy::graph::sentry_swh_package", Optional[String], 'first', undef) | $sentry_swh_package = lookup("swh::deploy::graph::sentry_swh_package", Optional[String], 'first', undef) | ||||
# install services from templates | # install services from templates | ||||
$services = [ { # this matches the current status | $services = [ { # this matches the current status | ||||
'name' => 'swhgraphshm', | 'name' => 'swh-graph-shm-mount', | ||||
'status' => 'running', | 'status' => 'running', | ||||
'enable' => false, | 'enable' => false, | ||||
}, { | }, { | ||||
'name' => 'swhgraphdev', | 'name' => 'swh-graph', | ||||
'status' => 'running', | 'status' => 'running', | ||||
'enable' => true, | 'enable' => true, | ||||
} | } | ||||
] | ] | ||||
each($services) | $service | { | each($services) | $service | { | ||||
$unit_name = "${service['name']}.service" | $unit_name = "${service['name']}.service" | ||||
# template uses: | # template uses: | ||||
Show All 18 Lines | class profile::swh::deploy::graph { | ||||
if $backend_listen_host == '0.0.0.0' { | if $backend_listen_host == '0.0.0.0' { | ||||
# It's not possible to directly test with the backend_listen_host in this case | # It's not possible to directly test with the backend_listen_host in this case | ||||
# so we fall back to localhost | # so we fall back to localhost | ||||
$local_check_address = '127.0.0.1' | $local_check_address = '127.0.0.1' | ||||
} else { | } else { | ||||
$local_check_address = $backend_listen_host | $local_check_address = $backend_listen_host | ||||
} | } | ||||
# swhgraphdev.service exposes the main graph server. | # swh-graph.service exposes the main graph server. | ||||
# Ensure the port is working ok through icinga checks | # Ensure the port is working ok through icinga checks | ||||
@@::icinga2::object::service {"swh-graph api (local on ${::fqdn})": | @@::icinga2::object::service {"swh-graph api (local on ${::fqdn})": | ||||
service_name => "swh-graph api (localhost)", | service_name => "swh-graph api (localhost)", | ||||
import => ['generic-service'], | import => ['generic-service'], | ||||
host_name => $::fqdn, | host_name => $::fqdn, | ||||
check_command => 'http', | check_command => 'http', | ||||
command_endpoint => $::fqdn, | command_endpoint => $::fqdn, | ||||
vars => { | vars => { | ||||
Show All 30 Lines |