diff options
author | Scott Dodson <sdodson@redhat.com> | 2015-11-23 15:21:23 -0500 |
---|---|---|
committer | Scott Dodson <sdodson@redhat.com> | 2015-12-15 15:45:45 -0500 |
commit | 7a2891780e827513859628c7703cc1e7be53683f (patch) | |
tree | 54745bd070661ecf47e37fd3dff8898810ff2f3e /roles/openshift_cli/templates | |
parent | d3edce9c192c8d1eba572ba45ca25c06d0fbb830 (diff) | |
download | openshift-7a2891780e827513859628c7703cc1e7be53683f.tar.gz openshift-7a2891780e827513859628c7703cc1e7be53683f.tar.bz2 openshift-7a2891780e827513859628c7703cc1e7be53683f.tar.xz openshift-7a2891780e827513859628c7703cc1e7be53683f.zip |
Add openshift_cli role
This role ensures that the clients package is installed or if it's a
containerized install places a wrapper script in /usr/local/bin/openshift and
symlinks for oc, oadm, and kubectl.
Diffstat (limited to 'roles/openshift_cli/templates')
-rw-r--r-- | roles/openshift_cli/templates/openshift.j2 | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/roles/openshift_cli/templates/openshift.j2 b/roles/openshift_cli/templates/openshift.j2 new file mode 100644 index 000000000..cade4d1a7 --- /dev/null +++ b/roles/openshift_cli/templates/openshift.j2 @@ -0,0 +1,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 }} ${@}
\ No newline at end of file |