aboutsummaryrefslogtreecommitdiffstats
path: root/ansible/roles/basics/tasks
diff options
context:
space:
mode:
authorKristian Lyngstol <kristian@bohemians.org>2016-05-12 10:39:13 +0200
committerKristian Lyngstol <kristian@bohemians.org>2016-05-12 10:39:13 +0200
commitce237012b417d5fefdb2480846aa8e6aa44ecb7b (patch)
tree9295d5f67d57e124a56e62cd0e1c1fb2af56c689 /ansible/roles/basics/tasks
parent4f29922e8287b2cea8d4c4cb749296a077a6735b (diff)
Move ansible stuff away from build/test
It's not just test... References #56
Diffstat (limited to 'ansible/roles/basics/tasks')
-rw-r--r--ansible/roles/basics/tasks/main.yml48
1 files changed, 48 insertions, 0 deletions
diff --git a/ansible/roles/basics/tasks/main.yml b/ansible/roles/basics/tasks/main.yml
new file mode 100644
index 0000000..dddc0c9
--- /dev/null
+++ b/ansible/roles/basics/tasks/main.yml
@@ -0,0 +1,48 @@
+- command: pwd
+ register: pwd
+- name: make all
+ docker_image:
+ state: build
+ name: "{{ item.name }}"
+ docker_api_version: 1.18
+ dockerfile: build/test/{{ item.name }}.Dockerfile
+ path: "{{ pwd.stdout }}"
+ with_items: "{{ images }}"
+ tags:
+ - build
+
+- name: stop all
+ docker:
+ name: "{{ item.name }}"
+ state: stopped
+ image: "{{ item.name }}"
+ docker_api_version: 1.18
+ stop_timeout: 2
+ with_items: "{{ images }}"
+ tags:
+ - stop
+
+- name: start all
+ docker:
+ name: "{{ item.name }}"
+ image: "{{ item.name }}"
+ docker_api_version: 1.18
+ state: started
+ net: bridge
+ links: "{{ item.links }}"
+ volumes: [ "{{ pwd.stdout }}/:/opt/nms" ]
+ with_items: "{{ images }}"
+ tags:
+ - start
+- name: workaround to get nms-varnish-front-ip
+ shell: "docker inspect nms-varnish-test | grep IPAddress | sed 's/[^0-9.]//g'"
+ register: ip
+ tags:
+ - start
+
+- name: Display IP
+ tags:
+ - start
+ debug:
+ msg: "Varnish test is available at http://{{ ip.stdout }}/"
+