Created
August 20, 2019 13:55
-
-
Save flickerfly/f0f2a07390dfc5f12c4ed9ebe1d7201d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# In OpenShift, docker containers are run as a random high number uid | |
# that doesn't exist in /etc/passwd, but some programs | |
# require a named user. So if we're in OpenShift, we need to make | |
# one before Ansible runs. | |
if [ `id -u` -ge 500 ]; then | |
echo "runner:x:`id -u`:`id -g`:,,,:/runner:/bin/bash" > /tmp/passwd | |
cat /tmp/passwd >> /etc/passwd | |
rm /tmp/passwd | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The above names the user running the container runner because I found this example in the Ansible Operator created by operator-sdk. That can of course, be changes to whatever user you like.