diff options
Diffstat (limited to 'ansible')
-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 |
11 files changed, 43 insertions, 26 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: |