diff --git a/puppet/zulip/manifests/profile/smokescreen.pp b/puppet/zulip/manifests/profile/smokescreen.pp index 27e5b0513b..262222fb6f 100644 --- a/puppet/zulip/manifests/profile/smokescreen.pp +++ b/puppet/zulip/manifests/profile/smokescreen.pp @@ -2,56 +2,5 @@ # class zulip::profile::smokescreen { include zulip::profile::base - include zulip::supervisor - include zulip::golang - - $version = 'dc403015f563eadc556a61870c6ad327688abe88' - $dir = "/srv/zulip-smokescreen-src-${version}/" - $bin = "/usr/local/bin/smokescreen-${version}-go-${zulip::golang::version}" - - zulip::external_dep { 'smokescreen-src': - version => $version, - url => "https://github.com/stripe/smokescreen/archive/${version}.tar.gz", - sha256 => 'ad4b181d14adcd9425045152b903a343dbbcfcad3c1e7625d2c65d1d50e1959d', - tarball_prefix => "smokescreen-${version}/", - } - - exec { 'compile smokescreen': - command => "${zulip::golang::bin} build -o ${bin}", - cwd => $dir, - # 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'], - } - 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 file above. Skip - # on Bionic, which has that old version; they'll get tidied upon - # upgrade to 20.04. - tidy { '/usr/local/bin/smokescreen-*': - path => '/usr/local/bin', - recurse => 1, - matches => 'smokescreen-*', - require => File[$bin], - } - } - - $listen_address = zulipconf('http_proxy', 'listen_address', '127.0.0.1') - file { "${zulip::common::supervisor_conf_dir}/smokescreen.conf": - ensure => file, - require => [ - Package[supervisor], - File[$bin], - ], - owner => 'root', - group => 'root', - mode => '0644', - content => template('zulip/supervisor/smokescreen.conf.erb'), - notify => Service[supervisor], - } + include zulip::smokescreen } diff --git a/puppet/zulip/manifests/smokescreen.pp b/puppet/zulip/manifests/smokescreen.pp new file mode 100644 index 0000000000..b4d5944660 --- /dev/null +++ b/puppet/zulip/manifests/smokescreen.pp @@ -0,0 +1,54 @@ +class zulip::smokescreen { + include zulip::supervisor + include zulip::golang + + $version = 'dc403015f563eadc556a61870c6ad327688abe88' + $dir = "/srv/zulip-smokescreen-src-${version}/" + $bin = "/usr/local/bin/smokescreen-${version}-go-${zulip::golang::version}" + + zulip::external_dep { 'smokescreen-src': + version => $version, + url => "https://github.com/stripe/smokescreen/archive/${version}.tar.gz", + sha256 => 'ad4b181d14adcd9425045152b903a343dbbcfcad3c1e7625d2c65d1d50e1959d', + tarball_prefix => "smokescreen-${version}/", + } + + exec { 'compile smokescreen': + command => "${zulip::golang::bin} build -o ${bin}", + cwd => $dir, + # 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'], + } + 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 file above. Skip + # on Bionic, which has that old version; they'll get tidied upon + # upgrade to 20.04. + tidy { '/usr/local/bin/smokescreen-*': + path => '/usr/local/bin', + recurse => 1, + matches => 'smokescreen-*', + require => File[$bin], + } + } + + $listen_address = zulipconf('http_proxy', 'listen_address', '127.0.0.1') + file { "${zulip::common::supervisor_conf_dir}/smokescreen.conf": + ensure => file, + require => [ + Package[supervisor], + File[$bin], + ], + owner => 'root', + group => 'root', + mode => '0644', + content => template('zulip/supervisor/smokescreen.conf.erb'), + notify => Service[supervisor], + } +}