diff options
author | Ole Mathias Heggem <ole@sdok.no> | 2017-04-19 23:16:07 +0200 |
---|---|---|
committer | Ole Mathias Heggem <ole@sdok.no> | 2017-04-19 23:16:07 +0200 |
commit | 7b97188b728c85c498acc8acdce1750c472f2c85 (patch) | |
tree | 12c1436ab7eb97e9434e774671e8ffea134d61db /ansible/roles/basics | |
parent | f70f65f7466a480a45a8260b35887cb7ed36b466 (diff) | |
parent | 7d404abf07d865d253ac2cfc353741e8d4af4867 (diff) |
Merge remote-tracking branch 'refs/remotes/tech-server/master'
Diffstat (limited to 'ansible/roles/basics')
-rw-r--r-- | ansible/roles/basics/tasks/main.yml | 66 |
1 files changed, 66 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..6a92a19 --- /dev/null +++ b/ansible/roles/basics/tasks/main.yml @@ -0,0 +1,66 @@ +- command: pwd + register: pwd + tags: + - build + - stop + - start + - test +- name: make all + docker_image: + state: present + docker_api_version: 1.18 + name: "{{ item.name }}" + dockerfile: build/test/{{ item.name }}.Dockerfile + path: "{{ pwd.stdout }}" + force: true + rm: false + with_items: "{{ images }}" + tags: + - build + +- name: stop all + docker: + name: "{{ item.name }}" + docker_api_version: 1.18 + state: stopped + image: "{{ item.name }}" + stop_timeout: 2 + with_items: "{{ images }}" + tags: + - stop + +- name: start all + docker_container: + name: "{{ item.name }}" + image: "{{ item.name }}" + docker_api_version: 1.18 + state: started + network_mode: bridge + recreate: true + restart: true + published_ports: "{{ item.ports }}" + links: "{{ item.links }}" + volumes: "{{ item.volumes }}" + with_items: "{{ images }}" + tags: + - start +- name: workaround to get gondul-varnish-front-ip + shell: "docker inspect gondul-varnish-test | grep IPAddress | sed 's/[^0-9.]//g' | grep 172.17 | uniq" + register: ip + tags: + - start + - test +- name: workaround to get gondul-front-ip + shell: "docker inspect gondul-front-test | grep IPAddress | sed 's/[^0-9.]//g' | grep 172.17 | uniq" + register: ipfront + tags: + - start + - test + +- name: Display IP + tags: + - start + - test + debug: + msg: "Varnish test is available at http://{{ ip.stdout }}/ uncached ip: http://{{ ipfront.stdout }}/ " + |