Give stack user passwordless sudo:

This is very helpful when performing automation.

Additionally, removed addition of stack user to admin group,
since that group does not exist on all systems, and
passwordless sudo eliminates the need it was addressing.

Change-Id: I727bd51acb920c6c2e66247069998b6ee4267895
This commit is contained in:
Tim Miller 2013-02-05 22:30:30 -08:00
parent 56e50ee5cf
commit 9806b6e737

View file

@ -4,9 +4,21 @@
set -e set -e
set -o xtrace set -o xtrace
useradd -G admin -m stack -s /bin/bash useradd -m stack -s /bin/bash
passwd stack <<EOF passwd stack <<EOF
stack stack
stack stack
EOF EOF
sudo_file=/etc/sudoers.d/stack
cat > /etc/sudoers.d/stack <<eof
# the stack user sometimes requires passwordless
# sudo for scripted operations.
stack ALL=(ALL) NOPASSWD:ALL
eof
chmod 0440 $sudo_file
visudo -c