Fix ps detection
This commit is contained in:
parent
9d251c1bbc
commit
ddd118e3bb
2 changed files with 13 additions and 3 deletions
|
|
@ -34,7 +34,7 @@ jobs:
|
|||
mkdir -m 755 -p /etc/apt/keyrings
|
||||
apt-get update
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||
ca-certificates curl gnupg git tar gzip findutils bash nodejs \
|
||||
ca-certificates curl gnupg git tar gzip findutils bash nodejs procps \
|
||||
ansible ansible-lint python3 python3-venv python3-pip pipx systemctl python3-apt jq python3-jsonschema \
|
||||
puppet hiera
|
||||
curl -fsSL https://packages.broadcom.com/artifactory/api/security/keypair/SaltProjectKey/public | gpg --dearmor | tee /etc/apt/keyrings/salt-archive-keyring.pgp > /dev/null
|
||||
|
|
@ -46,7 +46,7 @@ jobs:
|
|||
almalinux)
|
||||
dnf -y upgrade --refresh
|
||||
dnf -y install \
|
||||
ca-certificates curl-minimal gnupg2 git tar gzip findutils bash which jq nodejs \
|
||||
ca-certificates curl-minimal gnupg2 git tar gzip findutils bash which jq nodejs procps-ng \
|
||||
dnf-plugins-core epel-release
|
||||
dnf -y config-manager --set-enabled crb || true
|
||||
curl -fsSL https://github.com/saltstack/salt-install-guide/releases/latest/download/salt.repo > /etc/yum.repos.d/salt.repo
|
||||
|
|
|
|||
12
tests.sh
12
tests.sh
|
|
@ -90,9 +90,19 @@ require_supported_ci_os() {
|
|||
}
|
||||
|
||||
|
||||
pid1_comm() {
|
||||
if [[ -r /proc/1/comm ]]; then
|
||||
tr -d '[:space:]' </proc/1/comm || true
|
||||
return
|
||||
fi
|
||||
if command -v ps >/dev/null 2>&1; then
|
||||
ps -p 1 -o comm= 2>/dev/null | tr -d '[:space:]' || true
|
||||
fi
|
||||
}
|
||||
|
||||
configure_ansible_playbook_extra_args() {
|
||||
local pid1
|
||||
pid1="$(ps -p 1 -o comm= 2>/dev/null | tr -d '[:space:]' || true)"
|
||||
pid1="$(pid1_comm)"
|
||||
|
||||
ANSIBLE_PLAYBOOK_EXTRA_ARGS=()
|
||||
if [[ "${pid1}" != "systemd" ]]; then
|
||||
|
|
|
|||
Reference in a new issue