puppet: Stop making resources for external binaries and directories.

In the event that extracting doesn't produce the binary we expected it
to, all this will do is create an _empty_ file where we expect the
binary to be.  This will likely muddle debugging.

Since the only reason the resourfce was made in the first place was to
make dependencies clear, switch to depending on the External_Dep
itself, when such a dependency is needed.
This commit is contained in:
Alex Vandiver
2021-12-29 20:44:03 +00:00
committed by Tim Abbott
parent 3c163a7d5e
commit 1e4e6a09af
7 changed files with 12 additions and 31 deletions

View File

@@ -15,7 +15,6 @@ class zulip::camo (String $listen_address = '0.0.0.0') {
url => "https://github.com/cactus/go-camo/releases/download/v${version}/go-camo-${version}.go1171.linux-${::architecture}.tar.gz",
sha256 => '965506e6edb9d974c810519d71e847afb7ca69d1d01ae7d8be6d7a91de669c0c',
tarball_prefix => "go-camo-${version}",
bin => 'bin/go-camo',
}
file { "${zulip::common::supervisor_conf_dir}/go-camo.conf":
@@ -23,7 +22,7 @@ class zulip::camo (String $listen_address = '0.0.0.0') {
require => [
Package['camo'],
Package[supervisor],
File[$bin],
Zulip::External_Dep['go-camo'],
File['/usr/local/bin/secret-env-wrapper'],
],
owner => 'root',

View File

@@ -3,7 +3,6 @@ define zulip::external_dep(
String $sha256,
String $url,
String $tarball_prefix,
String $bin = '',
) {
$dir = "/srv/zulip-${title}-${version}"
@@ -16,18 +15,6 @@ define zulip::external_dep(
},
}
file { $dir:
ensure => directory,
require => Zulip::Sha256_tarball_to[$title],
}
if $bin != '' {
file { "${dir}/${bin}":
ensure => file,
require => File[$dir],
}
}
unless $::operatingsystem == 'Ubuntu' and $::operatingsystemrelease == '18.04' {
# Puppet 5.5.0 and below make this always-noisy, as they spout out
# a notify line about tidying the managed directory above. Skip
@@ -38,7 +25,7 @@ define zulip::external_dep(
recurse => 1,
rmdirs => true,
matches => "zulip-${title}-*",
require => File[$dir],
require => Zulip::Sha256_Tarball_To[$title],
}
}
}

View File

@@ -11,6 +11,5 @@ class zulip::golang {
url => "https://golang.org/dl/go${version}.linux-${::architecture}.tar.gz",
sha256 => '550f9845451c0c94be679faf116291e7807a8d78b43149f9506c1b15eb89008c',
tarball_prefix => 'go',
bin => 'bin/go',
}
}

View File

@@ -19,11 +19,10 @@ class zulip::smokescreen {
# GOCACHE is required; nothing is written to GOPATH, but it is required to be set
environment => ['GOCACHE=/tmp/gocache', 'GOPATH=/root/go'],
creates => $bin,
require => [File[$zulip::golang::bin], File[$dir]],
}
file { $bin:
ensure => file,
require => Exec['compile smokescreen'],
require => [
Zulip::External_Dep['golang'],
Zulip::External_Dep['smokescreen-src'],
],
}
unless $::operatingsystem == 'Ubuntu' and $::operatingsystemrelease == '18.04' {
# Puppet 5.5.0 and below make this always-noisy, as they spout out
@@ -34,7 +33,7 @@ class zulip::smokescreen {
path => '/usr/local/bin',
recurse => 1,
matches => 'smokescreen-*',
require => File[$bin],
require => Exec['compile smokescreen'],
}
}
@@ -43,7 +42,7 @@ class zulip::smokescreen {
ensure => file,
require => [
Package[supervisor],
File[$bin],
Exec['compile smokescreen'],
],
owner => 'root',
group => 'root',

View File

@@ -13,7 +13,6 @@ class zulip_ops::profile::grafana {
url => "https://dl.grafana.com/oss/release/grafana-${version}.linux-${::architecture}.tar.gz",
sha256 => '100f92c50aa612f213052c55594e58b68b7da641b751c5f144003d704730d189',
tarball_prefix => "grafana-${version}",
bin => 'bin/grafana-server',
}
group { 'grafana':
@@ -46,7 +45,7 @@ class zulip_ops::profile::grafana {
ensure => file,
require => [
Package[supervisor],
File[$bin],
Zulip::External_Dep['grafana'],
File['/var/lib/grafana'],
File['/var/log/grafana'],
],

View File

@@ -16,12 +16,11 @@ class zulip_ops::profile::prometheus_server {
url => "https://github.com/prometheus/prometheus/releases/download/v${version}/prometheus-${version}.linux-${::architecture}.tar.gz",
sha256 => 'ce637d0167d5e6d2561f3bd37e1c58fe8601e13e4e1ea745653c068f6e1317ae',
tarball_prefix => "prometheus-${version}.linux-${::architecture}",
bin => 'prometheus',
}
file { '/usr/local/bin/promtool':
ensure => 'link',
target => "${dir}/promtool",
require => File[$dir],
require => Zulip::External_Dep['prometheus'],
}
# This was moved to an external dep in 2021/12, and the below can be
# removed once the prod server has taken the update.
@@ -54,7 +53,7 @@ class zulip_ops::profile::prometheus_server {
ensure => file,
require => [
Package[supervisor],
File[$bin],
Zulip::External_Dep['prometheus'],
File[$data_dir],
File['/etc/prometheus/prometheus.yaml'],
],

View File

@@ -13,7 +13,6 @@ class zulip_ops::prometheus::node {
url => "https://github.com/prometheus/node_exporter/releases/download/v${version}/node_exporter-${version}.linux-${::architecture}.tar.gz",
sha256 => '8c1f6a317457a658e0ae68ad710f6b4098db2cad10204649b51e3c043aa3e70d',
tarball_prefix => "node_exporter-${version}.linux-${::architecture}",
bin => 'node_exporter',
}
# This was moved to an external_dep in 2021/12, and these lines can
@@ -28,7 +27,7 @@ class zulip_ops::prometheus::node {
require => [
User[zulip],
Package[supervisor],
File[$bin],
Zulip::External_Dep['node_exporter'],
],
owner => 'root',
group => 'root',