From ddb9d16132a6336b384bf674c4c950cd75d83e5c Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Fri, 30 Apr 2021 13:51:58 -0700 Subject: [PATCH] puppet: Install procps, for pgrep. In puppet, we use pgrep in the collection stage, to see if rabbitmq is running. Sufficiently bare-bones systems will not have `procps` (which provides `pgrep`) installed yet, which makes the install abort when running `puppet` for the first time. Just installing the `procps` package in Puppet is insufficient, because the check in the `unless` block runs when Puppet is determining which resources it needs to instantiate, and in what order; any package installation has yet to happen. As `erlang-base` (which provides `epmd`) happens to have a dependency of `procps`, any system without `pgrep` will also not have `epmd` installed or running. Regardless, it is safe to run `epmd -daemon` even if one is already running, as the comment above notes. --- puppet/zulip/manifests/profile/base.pp | 1 + puppet/zulip/manifests/profile/rabbitmq.pp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/puppet/zulip/manifests/profile/base.pp b/puppet/zulip/manifests/profile/base.pp index adbc5e4c3a..f69a72766c 100644 --- a/puppet/zulip/manifests/profile/base.pp +++ b/puppet/zulip/manifests/profile/base.pp @@ -45,6 +45,7 @@ class zulip::profile::base { 'curl', 'wget', 'jq', + 'procps', # Used to read /etc/zulip/zulip.conf for `zulipconf` Puppet function 'crudini', # Accurate time is essential diff --git a/puppet/zulip/manifests/profile/rabbitmq.pp b/puppet/zulip/manifests/profile/rabbitmq.pp index 83eb547d75..f78c9559ba 100644 --- a/puppet/zulip/manifests/profile/rabbitmq.pp +++ b/puppet/zulip/manifests/profile/rabbitmq.pp @@ -59,7 +59,7 @@ class zulip::profile::rabbitmq { # running and exits if so. exec { 'epmd': command => 'epmd -daemon', - unless => 'pgrep -f [e]pmd >/dev/null', + unless => 'which pgrep && pgrep -f [e]pmd >/dev/null', require => Package[$erlang], path => '/usr/bin/:/bin/', }