Add prepare-nginx role 37/88537/5
authorMichal Zegan <m.zegan@samsung.com>
Mon, 27 May 2019 11:59:16 +0000 (13:59 +0200)
committerMichal Ptacek <m.ptacek@partner.samsung.com>
Wed, 29 May 2019 10:43:40 +0000 (10:43 +0000)
This role can be used by nginx role/infra playbook tests.
It builds and archives the nginx docker image used
by these tests.

Change-Id: I51052f4d587926be0331203fffd0bbd69a7dc58d
Issue-ID: OOM-1816
Signed-off-by: Samuli Silvius <s.silvius@partner.samsung.com>
Signed-off-by: Michal Zegan <m.zegan@samsung.com>
ansible/test/roles/prepare-nginx/tasks/main.yml [new file with mode: 0644]

diff --git a/ansible/test/roles/prepare-nginx/tasks/main.yml b/ansible/test/roles/prepare-nginx/tasks/main.yml
new file mode 100644 (file)
index 0000000..3cd9399
--- /dev/null
@@ -0,0 +1,28 @@
+---
+- name: "Create needed dirs for nginx role"
+  file:
+    path: "{{ item }}"
+    state: directory
+    mode: "u+rw,g+wx,o+rwx"
+    recurse: true
+  loop:
+    - "{{ infra_images_path }}"
+
+- name: Build nginx docker image
+  delegate_to: localhost
+  docker_image:
+    path: ../../../../../build/creating_data/create_nginx_image/
+    name: own_nginx
+    tag: 2.0.0
+
+- name: Archive nginx docker image for the nginx role to use
+  delegate_to: localhost
+  docker_image:
+    name: own_nginx
+    tag: 2.0.0
+    archive_path: /tmp/nginx.tar
+
+- name: Copy nginx image to node
+  copy:
+    src: /tmp/nginx.tar
+    dest: "{{ infra_images_path }}/{{ nginx_server_image_tar }}"