Always add zuul group to zuul user

Not all distros - like openSUSE - create a separate group for each user.
Be explicit when creating zuul user like in
nodepool/elements/jenkins-slave/install.d/20-jenkins-slave.

Code later assumes that user and group are both named zuul, so we need
to set the specific zuul group.

Also, set /bin/bash as root shell following a similar change for
jenkins done in Ic671b7c5344a1e7980bede88bee730b50764e60b to keep these
two invocations in sync.

Change-Id: Iec8de3c0799aa023ace8f172f84bf8a137d0967b
This commit is contained in:
Andreas Jaeger 2017-04-28 08:50:03 +02:00
parent 2e308fc94a
commit ec333103e1
1 changed files with 5 additions and 1 deletions

View File

@ -6,7 +6,11 @@ fi
set -eu
set -o pipefail
useradd -m zuul
# Add zuul user and group. Note we don't want to rely on
# "useradd"'s group adding behaviour, because it might differ across
# distros.
groupadd zuul
useradd -m zuul -g zuul -s /bin/bash
cat > /etc/sudoers.d/zuul << EOF
zuul ALL=(ALL) NOPASSWD:ALL