Okay, let's see if these pauses are enough to get this passing

This commit is contained in:
Toshio Kuratomi
2015-03-18 17:57:29 -07:00
parent fd2d7fe447
commit 3c52c36629
2 changed files with 38 additions and 12 deletions

View File

@@ -8,6 +8,7 @@
image: busybox
state: present
pull: missing
docker_api_version: "1.14"
- name: Run a small script in busybox
docker:
@@ -16,6 +17,7 @@
pull: always
command: "nc -l -p 2000 -e xargs -n1 echo hello"
detach: True
docker_api_version: "1.14"
- name: Get the docker container id
shell: "docker ps | grep busybox | awk '{ print $1 }'"
@@ -25,6 +27,10 @@
shell: "docker inspect {{ container_id.stdout_lines[0] }} | grep IPAddress | awk -F '\"' '{ print $4 }'"
register: container_ip
- name: Pause a few moments because docker is not reliable
pause:
seconds: 40
- name: Try to access the server
shell: "echo 'world' | nc {{ container_ip.stdout_lines[0] }} 2000"
register: docker_output
@@ -43,6 +49,7 @@
TEST: hello
command: '/bin/sh -c "nc -l -p 2000 -e xargs -n1 echo $TEST"'
detach: True
docker_api_version: "1.14"
- name: Get the docker container id
shell: "docker ps | grep busybox | awk '{ print $1 }'"
@@ -52,6 +59,10 @@
shell: "docker inspect {{ container_id.stdout_lines[0] }} | grep IPAddress | awk -F '\"' '{ print $4 }'"
register: container_ip
- name: Pause a few moments because docker is not reliable
pause:
seconds: 40
- name: Try to access the server
shell: "echo 'world' | nc {{ container_ip.stdout_lines[0] }} 2000"
register: docker_output
@@ -62,5 +73,4 @@
- "'hello world' in docker_output.stdout_lines"
- name: Remove the busybox image from the local docker
shell: "docker rmi -f busybox"
shell: "docker rmi -f $(docker images -q)"