diff options
author | 2019-04-05 13:03:08 +0000 | |
---|---|---|
committer | 2019-04-05 13:03:08 +0000 | |
commit | d76d4e5948969fe0266645df7e06f973fdb9b44b (patch) | |
tree | 045ec3c09b37316ef44b2e3ddea29b960c15b0f3 | |
parent | 1bfd41937210685fb9a9ac318d124f16acdbe274 (diff) | |
parent | a0ad5c1091c43b96b7b54b4a2c4eca02d5f9a4eb (diff) |
Merge "Adding versions for infra related docker images"
-rwxr-xr-x | ansible/group_vars/all.yml | 3 | ||||
-rwxr-xr-x | ansible/group_vars/infrastructure.yml | 4 | ||||
-rw-r--r-- | ansible/roles/dns/defaults/main.yml | 3 | ||||
-rw-r--r-- | ansible/roles/dns/handlers/main.yml | 6 | ||||
-rw-r--r-- | ansible/roles/dns/tasks/main.yml | 16 | ||||
-rw-r--r-- | ansible/roles/nexus/defaults/main.yml | 2 | ||||
-rw-r--r-- | ansible/roles/nexus/tasks/install.yml | 8 | ||||
-rw-r--r-- | ansible/roles/nginx/defaults/main.yml | 2 | ||||
-rw-r--r-- | ansible/roles/nginx/tasks/main.yml | 12 | ||||
-rw-r--r-- | ansible/roles/vncserver/defaults/main.yml | 3 | ||||
-rw-r--r-- | ansible/roles/vncserver/tasks/main.yml | 10 | ||||
-rwxr-xr-x | build/creating_data/create_nginx_image/01create-image.sh | 6 | ||||
-rw-r--r-- | build/creating_data/create_nginx_image/Dockerfile | 2 | ||||
-rw-r--r-- | build/creating_data/create_nginx_image/VERSION | 1 | ||||
-rw-r--r-- | build/data_lists/infra_docker_images.list | 2 |
15 files changed, 51 insertions, 29 deletions
diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index f9d6726f..d8fe37dd 100755 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -31,6 +31,9 @@ resources_on_nfs: no # e.g. app_data_path: /opt/onap app_data_path: +# Path for tarballs with images loaded on infrastructure server +infra_images_path: "{{ app_data_path }}/offline_data/docker_images_infra" + # Path for auxiliary data in target infra server. # Data from resource host defined by aux_resources_filename variable is placed to this directory. # Currently docker images in tar format are supported (see runtime_images parameter). diff --git a/ansible/group_vars/infrastructure.yml b/ansible/group_vars/infrastructure.yml index a248a514..d4df2dfd 100755 --- a/ansible/group_vars/infrastructure.yml +++ b/ansible/group_vars/infrastructure.yml @@ -27,3 +27,7 @@ all_simulated_hosts: rancher_server_version: v1.6.22 populate_nexus: false helm_bin_dir: /usr/local/bin +vnc_server_image: consol/centos-icewm-vnc:1.4.0 +nexus3_image: sonatype/nexus3:3.15.2 +dns_server_image: andyshinn/dnsmasq:2.76 +nginx_server_image: own_nginx:2.0.0 diff --git a/ansible/roles/dns/defaults/main.yml b/ansible/roles/dns/defaults/main.yml new file mode 100644 index 00000000..f69d965d --- /dev/null +++ b/ansible/roles/dns/defaults/main.yml @@ -0,0 +1,3 @@ +--- +# Default rule for tarball naming translation +dns_server_image_tar: "{{ dns_server_image | regex_replace('(\\/|\\:)', '_') }}.tar" diff --git a/ansible/roles/dns/handlers/main.yml b/ansible/roles/dns/handlers/main.yml index ac3209dc..9d77893a 100644 --- a/ansible/roles/dns/handlers/main.yml +++ b/ansible/roles/dns/handlers/main.yml @@ -1,8 +1,8 @@ --- -- name: Restart dnsmasq container +- name: Restart dns server container docker_container: - name: dnsmasq - image: andyshinn/dnsmasq:2.76 + name: dns-server + image: "{{ dns_server_image }}" command: -H /simulated_hosts --log-facility=- capabilities: NET_ADMIN volumes: diff --git a/ansible/roles/dns/tasks/main.yml b/ansible/roles/dns/tasks/main.yml index 2bc05648..3eba9fdb 100644 --- a/ansible/roles/dns/tasks/main.yml +++ b/ansible/roles/dns/tasks/main.yml @@ -8,21 +8,21 @@ template: src: simulated_hosts.j2 dest: "{{ app_data_path }}/cfg/simulated_hosts" - notify: Restart dnsmasq container + notify: Restart dns server container -- name: Load dnsmasq container +- name: Load dns server container docker_image: - name: andyshinn/dnsmasq:2.76 - load_path: "{{ app_data_path }}/offline_data/docker_images_infra/andyshinn_dnsmasq_2.76.tar" + name: "{{ dns_server_image }}" + load_path: "{{ infra_images_path }}/{{ dns_server_image_tar }}" state: present timeout: 120 - notify: Restart dnsmasq container + notify: Restart dns server container -- name: Start dnsmasq container +- name: Start dns server container docker_container: - name: dnsmasq + name: dns-server network_mode: host - image: andyshinn/dnsmasq:2.76 + image: "{{ dns_server_image }}" command: -H /simulated_hosts --log-facility=- capabilities: NET_ADMIN dns_servers: diff --git a/ansible/roles/nexus/defaults/main.yml b/ansible/roles/nexus/defaults/main.yml index 3776f44e..92089e9a 100644 --- a/ansible/roles/nexus/defaults/main.yml +++ b/ansible/roles/nexus/defaults/main.yml @@ -4,3 +4,5 @@ populate_nexus: false # By dafault no additional docker images pushed to nexus at runtime # but all images are pre-populated either at buildtime or at install time (populate_nexus). runtime_images: {} +# Default rule for tarball naming translation +nexus3_image_tar: "{{ nexus3_image | regex_replace('(\\/|\\:)', '_') }}.tar" diff --git a/ansible/roles/nexus/tasks/install.yml b/ansible/roles/nexus/tasks/install.yml index 99d73dce..f8de5e95 100644 --- a/ansible/roles/nexus/tasks/install.yml +++ b/ansible/roles/nexus/tasks/install.yml @@ -8,8 +8,8 @@ - name: Load nexus image docker_image: - name: sonatype/nexus3 - load_path: "{{ app_data_path }}/offline_data/docker_images_infra/sonatype_nexus3_latest.tar" + name: "{{ nexus3_image }}" + load_path: "{{ infra_images_path }}/{{ nexus3_image_tar }}" state: present timeout: 120 @@ -18,10 +18,10 @@ name: nexus_network state: present -- name: Run nexus container +- name: Start nexus server container docker_container: name: nexus - image: sonatype/nexus3 + image: "{{ nexus3_image }}" networks: - name: nexus_network volumes: diff --git a/ansible/roles/nginx/defaults/main.yml b/ansible/roles/nginx/defaults/main.yml index 7c9fa0be..260de9bf 100644 --- a/ansible/roles/nginx/defaults/main.yml +++ b/ansible/roles/nginx/defaults/main.yml @@ -19,3 +19,5 @@ nginx: - "{{ 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 1ec0adbc..54a0c818 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 }}" diff --git a/ansible/roles/vncserver/defaults/main.yml b/ansible/roles/vncserver/defaults/main.yml new file mode 100644 index 00000000..e74ccb7c --- /dev/null +++ b/ansible/roles/vncserver/defaults/main.yml @@ -0,0 +1,3 @@ +--- +# Default rule for tarball naming translation +vnc_server_image_tar: "{{ vnc_server_image | regex_replace('(\\/|\\:)', '_') }}.tar" diff --git a/ansible/roles/vncserver/tasks/main.yml b/ansible/roles/vncserver/tasks/main.yml index 56ae707b..b1aaed9e 100644 --- a/ansible/roles/vncserver/tasks/main.yml +++ b/ansible/roles/vncserver/tasks/main.yml @@ -1,15 +1,15 @@ --- - name: Load VNC server image docker_image: - name: consol/centos-icewm-vnc:latest - load_path: '{{ app_data_path }}/offline_data/docker_images_infra/consol_centos_icewm_vnc_latest.tar' + name: "{{ vnc_server_image }}" + load_path: "{{ infra_images_path }}/{{ vnc_server_image_tar }}" state: present timeout: 120 -- name: Run VNC server +- name: Start VNC server container docker_container: - name: vnc_server - image: consol/centos-icewm-vnc + name: vnc-server + image: "{{ vnc_server_image }}" state: started restart_policy: unless-stopped ports: diff --git a/build/creating_data/create_nginx_image/01create-image.sh b/build/creating_data/create_nginx_image/01create-image.sh index aa62e40a..4ca382a7 100755 --- a/build/creating_data/create_nginx_image/01create-image.sh +++ b/build/creating_data/create_nginx_image/01create-image.sh @@ -18,6 +18,8 @@ # # COPYRIGHT NOTICE ENDS HERE +VERSION="$(cat $(dirname ${0})/VERSION)" + IMG_DIR="${1}" if [[ ! -e $IMG_DIR ]]; then @@ -26,5 +28,5 @@ fi script_dir="$(dirname ${BASH_SOURCE[0]})" cd "$script_dir" -docker build -t own_nginx . -docker -l error save -o "$IMG_DIR/own_nginx_latest.tar" "own_nginx:latest" +docker build -t own_nginx:${VERSION} . +docker -l error save -o "$IMG_DIR/own_nginx_${VERSION}.tar" "own_nginx:${VERSION}" diff --git a/build/creating_data/create_nginx_image/Dockerfile b/build/creating_data/create_nginx_image/Dockerfile index 6a14f221..27249ae9 100644 --- a/build/creating_data/create_nginx_image/Dockerfile +++ b/build/creating_data/create_nginx_image/Dockerfile @@ -20,6 +20,8 @@ FROM nginx:alpine RUN apk add --no-cache --update fcgiwrap git git-daemon spawn-fcgi +ADD VERSION . + COPY gitconfig /etc/ CMD spawn-fcgi -M 666 -s /var/run/fcgiwrap.socket /usr/bin/fcgiwrap && \ diff --git a/build/creating_data/create_nginx_image/VERSION b/build/creating_data/create_nginx_image/VERSION new file mode 100644 index 00000000..227cea21 --- /dev/null +++ b/build/creating_data/create_nginx_image/VERSION @@ -0,0 +1 @@ +2.0.0 diff --git a/build/data_lists/infra_docker_images.list b/build/data_lists/infra_docker_images.list index af156cfc..83374b8f 100644 --- a/build/data_lists/infra_docker_images.list +++ b/build/data_lists/infra_docker_images.list @@ -1,3 +1,3 @@ andyshinn/dnsmasq:2.76 -consol/centos-icewm-vnc:latest +consol/centos-icewm-vnc:1.4.0 sonatype/nexus3:3.15.2 |