puppet: Factor out $::architecture case statement for golang.

This commit is contained in:
Alex Vandiver 2022-02-11 11:37:31 -08:00 committed by Alex Vandiver
parent 19ab70c922
commit 788daa953b
5 changed files with 13 additions and 23 deletions

View File

@ -33,6 +33,11 @@ class zulip::common {
$total_memory_mb = Integer($::memorysize_mb)
$goarch = $::architecture ? {
'amd64' => 'amd64',
'aarch64' => 'arm64',
}
$versions = {
# https://github.com/cactus/go-camo/releases
'go-camo' => {

View File

@ -4,10 +4,6 @@ class zulip_ops::profile::grafana {
include zulip_ops::profile::base
include zulip::supervisor
$arch = $::architecture ? {
'amd64' => 'amd64',
'aarch64' => 'arm64',
}
$version = $zulip::common::versions['grafana']['version']
$dir = "/srv/zulip-grafana-${version}"
$bin = "${dir}/bin/grafana-server"
@ -15,7 +11,7 @@ class zulip_ops::profile::grafana {
zulip::external_dep { 'grafana':
version => $version,
url => "https://dl.grafana.com/oss/release/grafana-${version}.linux-${arch}.tar.gz",
url => "https://dl.grafana.com/oss/release/grafana-${version}.linux-${zulip::common::goarch}.tar.gz",
tarball_prefix => "grafana-${version}",
}

View File

@ -6,10 +6,6 @@ class zulip_ops::profile::prometheus_server {
include zulip_ops::profile::base
include zulip_ops::prometheus::base
$arch = $::architecture ? {
'amd64' => 'amd64',
'aarch64' => 'arm64',
}
$version = $zulip::common::versions['prometheus']['version']
$dir = "/srv/zulip-prometheus-${version}"
$bin = "${dir}/prometheus"
@ -17,8 +13,8 @@ class zulip_ops::profile::prometheus_server {
zulip::external_dep { 'prometheus':
version => $version,
url => "https://github.com/prometheus/prometheus/releases/download/v${version}/prometheus-${version}.linux-${arch}.tar.gz",
tarball_prefix => "prometheus-${version}.linux-${arch}",
url => "https://github.com/prometheus/prometheus/releases/download/v${version}/prometheus-${version}.linux-${zulip::common::goarch}.tar.gz",
tarball_prefix => "prometheus-${version}.linux-${zulip::common::goarch}",
}
file { '/usr/local/bin/promtool':
ensure => 'link',

View File

@ -4,18 +4,14 @@ class zulip_ops::prometheus::node {
include zulip_ops::prometheus::base
include zulip::supervisor
$arch = $::architecture ? {
'amd64' => 'amd64',
'aarch64' => 'arm64',
}
$version = $zulip::common::versions['node_exporter']['version']
$dir = "/srv/zulip-node_exporter-${version}"
$bin = "${dir}/node_exporter"
zulip::external_dep { 'node_exporter':
version => $version,
url => "https://github.com/prometheus/node_exporter/releases/download/v${version}/node_exporter-${version}.linux-${arch}.tar.gz",
tarball_prefix => "node_exporter-${version}.linux-${arch}",
url => "https://github.com/prometheus/node_exporter/releases/download/v${version}/node_exporter-${version}.linux-${zulip::common::goarch}.tar.gz",
tarball_prefix => "node_exporter-${version}.linux-${zulip::common::goarch}",
}
# This was moved to an external_dep in 2021/12, and these lines can

View File

@ -4,14 +4,11 @@ class zulip_ops::prometheus::uwsgi {
$version = $zulip::common::versions['uwsgi_exporter']['version']
$dir = "/srv/zulip-uwsgi_exporter-${version}"
$bin = "${dir}/uwsgi_exporter"
$arch = $::architecture ? {
'amd64' => 'amd64',
'aarch64' => 'arm64',
}
zulip::external_dep { 'uwsgi_exporter':
version => $version,
url => "https://github.com/timonwong/uwsgi_exporter/releases/download/v${version}/uwsgi_exporter-${version}.linux-${arch}.tar.gz",
tarball_prefix => "uwsgi_exporter-${version}.linux-${arch}",
url => "https://github.com/timonwong/uwsgi_exporter/releases/download/v${version}/uwsgi_exporter-${version}.linux-${zulip::common::goarch}.tar.gz",
tarball_prefix => "uwsgi_exporter-${version}.linux-${zulip::common::goarch}",
}
zulip_ops::firewall_allow { 'uwsgi_exporter': port => '9238' }