Adding versions for infra related docker images

1. latest tag replaced by version number for vnc server
2. added specific version for own_nginx image
3. version control improved in ansible roles accordingly

Solves OOM-1766

Issue-ID: OOM-1767

Change-Id: I147c56b46a419188099d8ed3e78fed68810893e2
Signed-off-by: Tomáš Levora <t.levora@partner.samsung.com>
diff --git a/ansible/roles/nginx/defaults/main.yml b/ansible/roles/nginx/defaults/main.yml
index 7c9fa0b..260de9b 100644
--- a/ansible/roles/nginx/defaults/main.yml
+++ b/ansible/roles/nginx/defaults/main.yml
@@ -19,3 +19,5 @@
     - "{{ app_data_path }}/pkg/rhel:/srv/http/repo.infra-server/rhel:rw"
     - "{{ app_data_path }}/pkg/ubuntu/xenial:/srv/http/repo.infra-server/ubuntu/xenial:rw"
     - /var/log/nginx:/var/log/nginx:rw
+# Default rule for tarball naming translation
+nginx_server_image_tar: "{{ nginx_server_image | regex_replace('(\\/|\\:)', '_') }}.tar"
diff --git a/ansible/roles/nginx/tasks/main.yml b/ansible/roles/nginx/tasks/main.yml
index 1ec0adb..54a0c81 100644
--- a/ansible/roles/nginx/tasks/main.yml
+++ b/ansible/roles/nginx/tasks/main.yml
@@ -9,10 +9,10 @@
     src: nginx.conf.j2
     dest: "{{ app_data_path }}/cfg/nginx.conf"
 
-- name: Load nginx image
+- name: Load nginx server image
   docker_image:
-    name: own_nginx
-    load_path: "{{ app_data_path }}/offline_data/docker_images_infra/own_nginx_latest.tar"
+    name: "{{ nginx_server_image }}"
+    load_path: "{{ infra_images_path }}/{{ nginx_server_image_tar }}"
     state: present
     timeout: 120
 
@@ -21,10 +21,10 @@
     name: nexus_network
     state: present
 
-- name: Start nginx
+- name: Start nginx server container
   docker_container:
-    name: own_nginx
-    image: own_nginx
+    name: nginx-server
+    image: "{{ nginx_server_image }}"
     networks:
       - name: nexus_network
     ports: "{{ nginx.ports }}"