summaryrefslogtreecommitdiffstats
path: root/ansible/test/roles
diff options
context:
space:
mode:
Diffstat (limited to 'ansible/test/roles')
-rw-r--r--ansible/test/roles/cleanup-application/tasks/main.yml9
-rw-r--r--ansible/test/roles/cleanup-dns/tasks/main.yml6
l---------ansible/test/roles/cleanup-nexus/defaults1
-rw-r--r--ansible/test/roles/cleanup-nexus/tasks/main.yml7
-rw-r--r--ansible/test/roles/cleanup-nginx/tasks/main.yml6
-rw-r--r--ansible/test/roles/cleanup-vncserver/tasks/main.yml6
-rw-r--r--ansible/test/roles/prepare-application/defaults/main.yml4
-rw-r--r--ansible/test/roles/prepare-application/tasks/main.yml25
-rw-r--r--ansible/test/roles/prepare-helm/defaults/main.yml3
-rw-r--r--ansible/test/roles/prepare-helm/tasks/main.yml14
-rw-r--r--ansible/test/roles/prepare-nexus/defaults/main.yml12
-rw-r--r--ansible/test/roles/prepare-nexus/tasks/main.yml55
-rw-r--r--ansible/test/roles/prepare-rke/tasks/infra.yml2
13 files changed, 81 insertions, 69 deletions
diff --git a/ansible/test/roles/cleanup-application/tasks/main.yml b/ansible/test/roles/cleanup-application/tasks/main.yml
new file mode 100644
index 00000000..cbb8d521
--- /dev/null
+++ b/ansible/test/roles/cleanup-application/tasks/main.yml
@@ -0,0 +1,9 @@
+---
+- name: Clean application role mocked artifacts directories
+ file:
+ path: "{{ item }}"
+ state: absent
+ delegate_to: localhost
+ loop:
+ - certs
+ - application
diff --git a/ansible/test/roles/cleanup-dns/tasks/main.yml b/ansible/test/roles/cleanup-dns/tasks/main.yml
new file mode 100644
index 00000000..738c3540
--- /dev/null
+++ b/ansible/test/roles/cleanup-dns/tasks/main.yml
@@ -0,0 +1,6 @@
+---
+- name: Remove saved dnsmasq image
+ delegate_to: localhost
+ file:
+ path: /tmp/dnsmasq.tar
+ state: absent
diff --git a/ansible/test/roles/cleanup-nexus/defaults b/ansible/test/roles/cleanup-nexus/defaults
new file mode 120000
index 00000000..d9144aae
--- /dev/null
+++ b/ansible/test/roles/cleanup-nexus/defaults
@@ -0,0 +1 @@
+../prepare-nexus/defaults/ \ No newline at end of file
diff --git a/ansible/test/roles/cleanup-nexus/tasks/main.yml b/ansible/test/roles/cleanup-nexus/tasks/main.yml
new file mode 100644
index 00000000..1d1e811b
--- /dev/null
+++ b/ansible/test/roles/cleanup-nexus/tasks/main.yml
@@ -0,0 +1,7 @@
+---
+- name: Remove saved docker images
+ delegate_to: localhost
+ file:
+ path: "{{ item.archive_path }}"
+ state: absent
+ loop: "{{ prepare_nexus_images }}"
diff --git a/ansible/test/roles/cleanup-nginx/tasks/main.yml b/ansible/test/roles/cleanup-nginx/tasks/main.yml
new file mode 100644
index 00000000..94517519
--- /dev/null
+++ b/ansible/test/roles/cleanup-nginx/tasks/main.yml
@@ -0,0 +1,6 @@
+---
+- name: Remove saved nginx docker image
+ delegate_to: localhost
+ file:
+ path: /tmp/nginx.tar
+ state: absent
diff --git a/ansible/test/roles/cleanup-vncserver/tasks/main.yml b/ansible/test/roles/cleanup-vncserver/tasks/main.yml
new file mode 100644
index 00000000..1fcb37d8
--- /dev/null
+++ b/ansible/test/roles/cleanup-vncserver/tasks/main.yml
@@ -0,0 +1,6 @@
+---
+- name: Remove saved vncserver docker image
+ delegate_to: localhost
+ file:
+ path: /tmp/vncserver.tar
+ state: absent
diff --git a/ansible/test/roles/prepare-application/defaults/main.yml b/ansible/test/roles/prepare-application/defaults/main.yml
index 227bd4f0..c3883c65 100644
--- a/ansible/test/roles/prepare-application/defaults/main.yml
+++ b/ansible/test/roles/prepare-application/defaults/main.yml
@@ -1,4 +1,6 @@
---
simulate_helm: true
app_helm_charts_install_directory: application/helm_charts
-helm_simulation_output_file: /tmp/helm_simu_output \ No newline at end of file
+helm_simulation_output_file: /tmp/helm_simu_output
+application_pre_install_role: application/test-patch-role
+application_post_install_role: application/test-patch-role
diff --git a/ansible/test/roles/prepare-application/tasks/main.yml b/ansible/test/roles/prepare-application/tasks/main.yml
index 2f143a07..75abb802 100644
--- a/ansible/test/roles/prepare-application/tasks/main.yml
+++ b/ansible/test/roles/prepare-application/tasks/main.yml
@@ -1,9 +1,14 @@
---
-- name: Create Application helm charts directory
+- name: Create application role mocked artifacts directories
file:
- path: "{{ app_helm_charts_install_directory }}"
+ path: "{{ item }}"
state: directory
delegate_to: localhost
+ loop:
+ - "{{ app_helm_charts_install_directory }}"
+ - certs
+ - "{{ application_pre_install_role + '/tasks/' }}"
+ - "{{ application_post_install_role + '/tasks/' }}"
- name: Create Makefile to simulate helm charts dir and make building
copy:
@@ -33,15 +38,19 @@
name: make
state: present
-- name: Create local certs dir for dummy certs
- file:
- path: certs
- state: directory
- delegate_to: localhost
-
- name: Create dummy cert file to simulate offline server certificates in helm install with override.yml file
copy:
content: |
this is dummy server certificate value
dest: certs/rootCA.crt
delegate_to: localhost
+
+- name: Create test patch role files
+ copy:
+ content: |
+ ---
+ - name: Mocked up patch role
+ debug:
+ msg: "Noop task to mock up patch role"
+ dest: application/test-patch-role/tasks/main.yml
+ delegate_to: localhost
diff --git a/ansible/test/roles/prepare-helm/defaults/main.yml b/ansible/test/roles/prepare-helm/defaults/main.yml
deleted file mode 100644
index 8ab9ed3a..00000000
--- a/ansible/test/roles/prepare-helm/defaults/main.yml
+++ /dev/null
@@ -1,3 +0,0 @@
----
-# Helm version to download.
-helm_version: 2.12.3
diff --git a/ansible/test/roles/prepare-helm/tasks/main.yml b/ansible/test/roles/prepare-helm/tasks/main.yml
index aa01e281..1f461258 100644
--- a/ansible/test/roles/prepare-helm/tasks/main.yml
+++ b/ansible/test/roles/prepare-helm/tasks/main.yml
@@ -5,14 +5,8 @@
recurse: true
state: directory
-- name: "Download and unarchive helm-{{ helm_version }}"
- unarchive:
- src: "https://get.helm.sh/helm-v{{ helm_version }}-linux-amd64.tar.gz"
- dest: "/tmp"
- remote_src: true
-
-- name: "Copy helm binary"
- copy:
- src: /tmp/linux-amd64/helm
- dest: "{{ app_data_path }}/downloads/helm"
+- name: "Download helm-{{ helm_version }}"
+ get_url:
+ url: "https://get.helm.sh/helm-{{ helm_version }}-linux-amd64.tar.gz"
+ dest: "{{ app_data_path }}/downloads"
remote_src: true
diff --git a/ansible/test/roles/prepare-nexus/defaults/main.yml b/ansible/test/roles/prepare-nexus/defaults/main.yml
new file mode 100644
index 00000000..4e76f603
--- /dev/null
+++ b/ansible/test/roles/prepare-nexus/defaults/main.yml
@@ -0,0 +1,12 @@
+---
+prepare_nexus_images:
+ - name: "{{ nexus3_image }}" # name already contains tag so it's ommited in this list element
+ archive_path: /tmp/nexus.tar
+ dest: "{{ infra_images_path }}/{{ nexus3_image_tar }}"
+ - name: nexus3.onap.org:10001/busybox
+ tag: latest
+ archive_path: /tmp/busybox.tar
+ dest: "{{ aux_data_path }}/busybox.tar"
+ - name: nexus3.onap.org:10001/library/alpine
+ archive_path: /tmp/alpine.tar
+ dest: "{{ aux_data_path }}/alpine.tar"
diff --git a/ansible/test/roles/prepare-nexus/tasks/main.yml b/ansible/test/roles/prepare-nexus/tasks/main.yml
index 4ef40f5e..951bc28e 100644
--- a/ansible/test/roles/prepare-nexus/tasks/main.yml
+++ b/ansible/test/roles/prepare-nexus/tasks/main.yml
@@ -18,53 +18,16 @@
- "{{ infra_images_path }}"
- "{{ aux_data_path }}"
-- name: Download and archive nexus docker image for the nexus role to use
+- name: Download and archive docker images for the nexus role to use
delegate_to: localhost
docker_image:
- name: "{{ nexus3_image }}"
- archive_path: /tmp/nexus.tar
+ name: "{{ item.name }}"
+ tag: "{{ item.tag | default('latest') }}" # Tag given in 'name' has precedence over the one declared here
+ archive_path: "{{ item.archive_path }}"
+ loop: "{{ prepare_nexus_images }}"
-- name: Download and tag additional (busybox) docker image for the nexus role to populate into
- delegate_to: localhost
- docker_image:
- name: busybox
- tag: latest
- repository: nexus3.onap.org:10001/onap/components/busybox
-
-- name: Save busybox image
- delegate_to: localhost
- docker_image:
- name: nexus3.onap.org:10001/onap/components/busybox
- tag: latest
- pull: false
- archive_path: /tmp/busybox.tar
-
-- name: Download and tag additional (aaionap/haproxy) docker image for the nexus role to populate into nexus
- delegate_to: localhost
- docker_image:
- name: aaionap/haproxy
- tag: 1.2.4
- repository: nexus3.onap.org:10001/onap/components/aaionap/haproxy
-
-- name: Save haproxy image
- delegate_to: localhost
- docker_image:
- name: nexus3.onap.org:10001/onap/components/aaionap/haproxy
- tag: 1.2.4
- pull: false
- archive_path: /tmp/haproxy.tar
-
-- name: Copy nexus image to node
- copy:
- src: /tmp/nexus.tar
- dest: "{{ infra_images_path }}/{{ nexus3_image_tar }}"
-
-- name: Copy busybox image to node
- copy:
- src: /tmp/busybox.tar
- dest: "{{ aux_data_path }}/busybox.tar"
-
-- name: Copy haproxy image to node
+- name: Copy docker images to node
copy:
- src: /tmp/haproxy.tar
- dest: "{{ aux_data_path }}/aaionap-haproxy.tar"
+ src: "{{ item.archive_path }}"
+ dest: "{{ item.dest }}"
+ loop: "{{ prepare_nexus_images }}"
diff --git a/ansible/test/roles/prepare-rke/tasks/infra.yml b/ansible/test/roles/prepare-rke/tasks/infra.yml
index 55ab7f16..e9971f77 100644
--- a/ansible/test/roles/prepare-rke/tasks/infra.yml
+++ b/ansible/test/roles/prepare-rke/tasks/infra.yml
@@ -7,7 +7,7 @@
- name: "Install rke-{{ rke_version }}"
get_url:
url: "https://github.com/rancher/rke/releases/download/v{{ rke_version }}/rke_linux-amd64"
- dest: "{{ app_data_path }}/downloads/rke"
+ dest: "{{ app_data_path }}/downloads/rke_linux-amd64"
- name: "Install kubectl-{{ kubectl_version }}"
get_url: