From: Ross Brattain Date: Wed, 25 Apr 2018 14:47:35 +0000 (-0700) Subject: nsb_setup: parametrize docker image X-Git-Tag: opnfv-7.0.0~308^2 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=9a060b441765f04ac086c07f157abf9d90d9e883;p=yardstick.git nsb_setup: parametrize docker image The user may need to pull a different image stable or a tagged release version. Since we can't pull a tagged image before it is tagged just give up and make it an argument JIRA: YARDSTICK-1137 Change-Id: I0caf0f8915c191786c7db6d929be2fa350a545af Signed-off-by: Ross Brattain --- diff --git a/ansible/nsb_setup.yml b/ansible/nsb_setup.yml index 98a59f984..92f5d8390 100644 --- a/ansible/nsb_setup.yml +++ b/ansible/nsb_setup.yml @@ -37,7 +37,7 @@ name: yardstick pull: yes recreate: yes - image: opnfv/yardstick:latest + image: "{{ yardstick_docker_image|default('opnfv/yardstick:latest') }}" state: started restart_policy: always privileged: yes diff --git a/nsb_setup.sh b/nsb_setup.sh index 50fc017d1..86796c4d4 100755 --- a/nsb_setup.sh +++ b/nsb_setup.sh @@ -67,8 +67,16 @@ pip install ansible==2.4.2 shade==1.22.2 docker-py==1.10.6 ANSIBLE_SCRIPTS="ansible" +if [[ -n ${1} ]]; then + yardstick_docker_image="-e yardstick_docker_image=${1}" +else + yardstick_docker_image="" +fi + +# no quotes for yardstick_docker_image so when empty it is removed as whitespace cd ${ANSIBLE_SCRIPTS} &&\ ansible-playbook \ -e img_property="nsb" \ + ${yardstick_docker_image} \ -e YARD_IMG_ARCH='amd64' ${extra_args}\ -i yardstick-install-inventory.ini nsb_setup.yml