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.
This commit is contained in:
Alex Vandiver
2021-04-30 13:51:58 -07:00
committed by Tim Abbott
parent 3577c6dbd4
commit ddb9d16132
2 changed files with 2 additions and 1 deletions

View File

@@ -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

View File

@@ -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/',
}