summaryrefslogtreecommitdiffstats
path: root/roles/openshift_cli/templates/openshift.j2
blob: cade4d1a71b63ad0b2376f6dd13aba02716a6e44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash
if [ ! -d ~/.kube ]; then
   mkdir -m 0700 ~/.kube
fi
cmd=`basename $0`
user=`id -u`
group=`id -g`

# docker can only split stderr and stdin when run without -t
# https://github.com/docker/docker/issues/725
# ansible checks various streams DO NOT CROSS THE STREAMS
if [ -z $TERM ]; then
  $t = '-it'
fi

docker run ${t} -a STDERR -a STDOUT -a STDIN --privileged --net=host --user=${user}:${group} -v ~/.kube:/root/.kube -v /tmp:/tmp -v {{ openshift.common.config_base}}:{{ openshift.common.config_base }} -e KUBECONFIG=/root/.kube/config --entrypoint ${cmd} --rm {{ openshift.common.cli_image }} ${@}