diff options
author | Brenton Leanhardt <bleanhar@redhat.com> | 2016-06-07 13:51:44 -0400 |
---|---|---|
committer | Brenton Leanhardt <bleanhar@redhat.com> | 2016-06-07 13:51:44 -0400 |
commit | 12f351d71b13feb4b808b15f6756fbf6a81de587 (patch) | |
tree | 8cd3ea02fb98cae19a6288b02abc508b728c8fc0 /roles/openshift_cli | |
parent | 377405b67551ef51ce6f644bde018986465a1e0c (diff) | |
parent | c45c5935df97bb4aa9e8e9067d868371b04a24bf (diff) | |
download | openshift-12f351d71b13feb4b808b15f6756fbf6a81de587.tar.gz openshift-12f351d71b13feb4b808b15f6756fbf6a81de587.tar.bz2 openshift-12f351d71b13feb4b808b15f6756fbf6a81de587.tar.xz openshift-12f351d71b13feb4b808b15f6756fbf6a81de587.zip |
Merge branch 'docker1.10' of https://github.com/dgoodwin/openshift-ansible
Diffstat (limited to 'roles/openshift_cli')
-rw-r--r-- | roles/openshift_cli/tasks/main.yml | 2 | ||||
-rw-r--r-- | roles/openshift_cli/templates/openshift.j2 | 10 |
2 files changed, 8 insertions, 4 deletions
diff --git a/roles/openshift_cli/tasks/main.yml b/roles/openshift_cli/tasks/main.yml index bfa60e5b0..c0a712513 100644 --- a/roles/openshift_cli/tasks/main.yml +++ b/roles/openshift_cli/tasks/main.yml @@ -5,7 +5,7 @@ - name: Pull CLI Image command: > - docker pull {{ openshift.common.cli_image }}:{{ openshift_version }} + docker pull {{ openshift.common.cli_image }}{{ ':' + openshift_version if openshift_version is defined and openshift_version != '' else '' }} when: openshift.common.is_containerized | bool - name: Create /usr/local/bin/openshift cli wrapper diff --git a/roles/openshift_cli/templates/openshift.j2 b/roles/openshift_cli/templates/openshift.j2 index 437e08aab..8a3f3a257 100644 --- a/roles/openshift_cli/templates/openshift.j2 +++ b/roles/openshift_cli/templates/openshift.j2 @@ -5,14 +5,14 @@ fi cmd=`basename $0` user=`id -u` group=`id -g` -image_tag={{ openshift_version }} +image_tag="{{ openshift_version }}" >&2 echo """ ================================================================================ ATTENTION: You are running ${cmd} via a wrapper around 'docker run {{ openshift.common.cli_image }}:${image_tag}'. This wrapper is intended only to be used to bootstrap an environment. Please install client tools on another host once you have granted cluster-admin -privileges to a user. +privileges to a user. {% if openshift.common.deployment_type in ['openshift-enterprise','atomic-enterprise'] %} See https://docs.openshift.com/enterprise/latest/cli_reference/get_started_cli.html {% else %} @@ -21,4 +21,8 @@ See https://docs.openshift.org/latest/cli_reference/get_started_cli.html ================================================================================= """ -docker run -i --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 }}:${image_tag} "${@}" +if [ -n "$image_tag" ]; then + image_tag=":$image_tag" +fi + +docker run -i --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 }}${image_tag} "${@}" |