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 resource 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.

(cherry picked from commit 1e4e6a09af)
This commit is contained in:
Alex Vandiver
2021-12-29 20:44:03 +00:00
committed by Tim Abbott
parent ebd74239a2
commit 1b27ec9fae
4 changed files with 8 additions and 24 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-amd64.tar.gz",
sha256 => '965506e6edb9d974c810519d71e847afb7ca69d1d01ae7d8be6d7a91de669c0c',
tarball_prefix => "go-camo-${version}",
bin => 'bin/go-camo',
}
# We would like to not waste resources by going through Smokescreen,
@@ -46,7 +45,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-amd64.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',