technolo-g / docker-swarm-demo

A demo of Docker Swarm
118 stars 19 forks source link

the playbook: vagrant_docker_images.yml could not be found #5

Open jglick opened 9 years ago

jglick commented 9 years ago

Software versions as in #4. Trying to set up this demo using TLS, I first made the following edits (no idea if these are right; README.md seems to assume a familiarity with Ansible):

diff --git a/ansible/roles/docker/defaults/main.yml b/ansible/roles/docker/defaults/main.yml
index 08fc3b9..7065701 100644
--- a/ansible/roles/docker/defaults/main.yml
+++ b/ansible/roles/docker/defaults/main.yml
@@ -1,7 +1,7 @@
 ---

 start_docker_service: True
-use_tls: False
-docker_port: 2375
+use_tls: True
+docker_port: 2376
 docker_swarm_tags:
-  - 'none=none'
\ No newline at end of file
+  - 'none=none'
diff --git a/ansible/roles/docker_swarm/defaults/main.yml b/ansible/roles/docker_swarm/defaults/main.yml
index 4587d4b..e0eb69d 100644
--- a/ansible/roles/docker_swarm/defaults/main.yml
+++ b/ansible/roles/docker_swarm/defaults/main.yml
@@ -1,7 +1,7 @@
 ---

-use_tls: false
+use_tls: True
 packing_strategy: random
-docker_port: 2375
+docker_port: 2376
 swarm_discovery: file
 swarm_discovery_string: 'file:///etc/swarm_config'
diff --git a/ansible/vagrant_docker_host.yml b/ansible/vagrant_docker_host.yml
index bdc2847..1c9fc7b 100644
--- a/ansible/vagrant_docker_host.yml
+++ b/ansible/vagrant_docker_host.yml
@@ -4,8 +4,7 @@
   sudo: False
   remote_user: "{{ user }}"
   vars:
-    swarm_discovery: consul
-    swarm_discovery_string: "consul://{{ consul_host }}/swarm"
+    swarm_discovery: file
   roles:
     - role: base
     - role: docker
diff --git a/ansible/vagrant_docker_swarm.yml b/ansible/vagrant_docker_swarm.yml
index 2f932a3..88ea729 100644
--- a/ansible/vagrant_docker_swarm.yml
+++ b/ansible/vagrant_docker_swarm.yml
@@ -11,8 +11,7 @@
     consul_node_name: "vagrant"
     consul_bind_address: "{{ ansible_default_ipv4['address'] }}"
     nginx_remove_default: true
-    swarm_discovery: consul
-    swarm_discovery_string: "consul://{{ consul_host }}/swarm"
+    swarm_discovery: file

   roles:
     - role: base

and then ran

./bin/gen_ssl.sh && vagrant up && source bin/env_tls && ./bin/pull_images_tls.sh && ansible-playbook vagrant_docker_images.yml && docker ps && docker run --rm -i -t  ubuntu:latest /bin/bash

Eventually this died:

…
PLAY RECAP ******************************************************************** 
dockerswarm01              : ok=54   changed=44   unreachable=0    failed=0   
…
42a3cf88f3f0: Already exists 
Digest: sha256:a0270163dd1bbb456d77996eb77114b0abd6f82208bd3a30527a8bf523879b8b
Status: Image is up to date for nginx:latest
ERROR: the playbook: vagrant_docker_images.yml could not be found
technolo-g commented 9 years ago

@jglick try

./bin/gen_ssl.sh && vagrant up && source bin/env_tls && ./bin/pull_images_tls.sh && cd ansible && ansible-playbook vagrant_docker_images.yml && docker ps && docker run --rm -i -t  ubuntu:latest /bin/bash

Note that we're changing into the ansible directory before trying to run the playbook.