summaryrefslogtreecommitdiffstats
path: root/ansible/test/roles
diff options
context:
space:
mode:
Diffstat (limited to 'ansible/test/roles')
-rw-r--r--ansible/test/roles/cleanup-containers/tasks/main.yml6
-rw-r--r--ansible/test/roles/cleanup-directories/tasks/main.yml7
-rw-r--r--ansible/test/roles/cleanup-rancher/tasks/main.yml18
-rw-r--r--ansible/test/roles/prepare-docker/tasks/docker-packages.yml10
-rw-r--r--ansible/test/roles/prepare-docker/tasks/docker-socket-override.yml13
-rw-r--r--ansible/test/roles/prepare-docker/tasks/enable-repos.yml13
-rw-r--r--ansible/test/roles/prepare-docker/tasks/main.yml21
-rw-r--r--ansible/test/roles/prepare-docker/tasks/prepare-docker-repos.yml20
-rw-r--r--ansible/test/roles/prepare-docker/vars/main.yml7
-rw-r--r--ansible/test/roles/prepare-helm/defaults/main.yml3
-rw-r--r--ansible/test/roles/prepare-helm/tasks/main.yml18
11 files changed, 21 insertions, 115 deletions
diff --git a/ansible/test/roles/cleanup-containers/tasks/main.yml b/ansible/test/roles/cleanup-containers/tasks/main.yml
deleted file mode 100644
index 3a800c9e..00000000
--- a/ansible/test/roles/cleanup-containers/tasks/main.yml
+++ /dev/null
@@ -1,6 +0,0 @@
----
-- name: Remove containers
- docker_container:
- name: "{{ item }}"
- state: absent
- loop: "{{ container_list }}"
diff --git a/ansible/test/roles/cleanup-directories/tasks/main.yml b/ansible/test/roles/cleanup-directories/tasks/main.yml
deleted file mode 100644
index 8e79ea0c..00000000
--- a/ansible/test/roles/cleanup-directories/tasks/main.yml
+++ /dev/null
@@ -1,7 +0,0 @@
----
-- name: Remove directories/files
- file:
- path: "{{ item }}"
- state: absent
- become: true
- loop: "{{ directories_files_list_to_remove }}"
diff --git a/ansible/test/roles/cleanup-rancher/tasks/main.yml b/ansible/test/roles/cleanup-rancher/tasks/main.yml
deleted file mode 100644
index 21b02988..00000000
--- a/ansible/test/roles/cleanup-rancher/tasks/main.yml
+++ /dev/null
@@ -1,18 +0,0 @@
----
-# Remove containers spawned by Rancher Agent
-- name: Get list of containers spawned by Rancher Agent
- docker_list_containers:
- label_name: "{{ item.label }}"
- label_value: "{{ item.value }}"
- loop: "{{ container_list_by_label }}"
- register: docker_list_containers_var
-
-- name: set fact # save a list of containers found by previous task to orphaned_containers var
- set_fact: orphaned_containers="{{ orphaned_containers|default([]) + item.containers }}"
- loop: "{{ docker_list_containers_var.results }}"
-
-- name: Remove orphaned containers
- docker_container:
- name: "{{ item }}"
- state: absent
- loop: "{{ orphaned_containers }}"
diff --git a/ansible/test/roles/prepare-docker/tasks/docker-packages.yml b/ansible/test/roles/prepare-docker/tasks/docker-packages.yml
deleted file mode 100644
index 8f55c5ce..00000000
--- a/ansible/test/roles/prepare-docker/tasks/docker-packages.yml
+++ /dev/null
@@ -1,10 +0,0 @@
----
-
-- name: Download docker related packages
- command: yumdownloader --destdir="{{ rpm_dir }}" "{{ docker_ce_rpm }}"
- args:
- creates: "{{ rpm_dir }}/{{ docker_ce_rpm }}"
-
-- name: Install docker related packages
- yum:
- name: "{{ rpm_dir + '/' + docker_ce_rpm + '.rpm'}}"
diff --git a/ansible/test/roles/prepare-docker/tasks/docker-socket-override.yml b/ansible/test/roles/prepare-docker/tasks/docker-socket-override.yml
deleted file mode 100644
index 0cabadf4..00000000
--- a/ansible/test/roles/prepare-docker/tasks/docker-socket-override.yml
+++ /dev/null
@@ -1,13 +0,0 @@
----
-- name: Create docker.socket systemd dir for override
- file:
- path: /etc/systemd/system/docker.socket.d
- state: directory
-
-- name: Fake dockerd dependent docker.socket service not to actually listen the docker socket as dockerd is not used in container only docker client
- copy:
- content: |
- [Socket]
- ListenStream=
- ListenStream=/tmp/fake
- dest: /etc/systemd/system/docker.socket.d/override.conf
diff --git a/ansible/test/roles/prepare-docker/tasks/enable-repos.yml b/ansible/test/roles/prepare-docker/tasks/enable-repos.yml
deleted file mode 100644
index 204bf03d..00000000
--- a/ansible/test/roles/prepare-docker/tasks/enable-repos.yml
+++ /dev/null
@@ -1,13 +0,0 @@
----
-- name: Enable docker repos back for Molecule testing purposes
- copy:
- remote_src: yes
- src: "{{ item }}"
- dest: "{{ (item | splitext)[0] }}"
- loop: "{{ docker_needed_repos }}"
-
-- name: Disable offline repo for molecule testing purposes
- lineinfile:
- path: "{{ offline_repo_file }}"
- regexp: 'enabled = 1'
- line: 'enabled = 0'
diff --git a/ansible/test/roles/prepare-docker/tasks/main.yml b/ansible/test/roles/prepare-docker/tasks/main.yml
deleted file mode 100644
index e7d87061..00000000
--- a/ansible/test/roles/prepare-docker/tasks/main.yml
+++ /dev/null
@@ -1,21 +0,0 @@
----
-- name: Check repositories
- stat:
- path: "{{ item }}"
- loop: "{{ docker_needed_repos + [offline_repo_file] }}"
- register: repos
-
-- name: Set fact for offline repos created
- set_fact:
- offline_repo_created: "{{ (repos.results | map(attribute='stat.exists') | list) is all }}"
-
-- debug:
- var: offline_repo_created
-
-- name: Enable repos back (if package-repository role already setup offline onap repo) for molecule testing purposes to install docker
- include_tasks: enable-repos.yml
- when: offline_repo_created
-
-- name: Prepare docker repos normally
- include_tasks: prepare-docker-repos.yml
- when: not offline_repo_created
diff --git a/ansible/test/roles/prepare-docker/tasks/prepare-docker-repos.yml b/ansible/test/roles/prepare-docker/tasks/prepare-docker-repos.yml
deleted file mode 100644
index 01ea72c3..00000000
--- a/ansible/test/roles/prepare-docker/tasks/prepare-docker-repos.yml
+++ /dev/null
@@ -1,20 +0,0 @@
----
-- name: Install Docker-CE repo
- yum_repository:
- name: docker-ce
- description: Docker-ce YUM repo
- baseurl: https://download.docker.com/linux/centos/7/x86_64/stable/
- gpgcheck: true
- gpgkey: https://download.docker.com/linux/centos/gpg
-
-- name: Create rpm dir
- file:
- path: "{{ rpm_dir }}"
- state: directory
-
-- name: Handle docker-ce packages
- import_tasks: docker-packages.yml
-
-- name: Fake dockerd on container
- import_tasks: docker-socket-override.yml
- when: ansible_env.container == 'docker'
diff --git a/ansible/test/roles/prepare-docker/vars/main.yml b/ansible/test/roles/prepare-docker/vars/main.yml
deleted file mode 100644
index bcd7f365..00000000
--- a/ansible/test/roles/prepare-docker/vars/main.yml
+++ /dev/null
@@ -1,7 +0,0 @@
----
-docker_needed_repos:
- - /etc/yum.repos.d/CentOS-Base.repo.disabled
- - /etc/yum.repos.d/docker-ce.repo.disabled
-offline_repo_file: /etc/yum.repos.d/onap.repo
-rpm_dir: /root/rpm
-docker_ce_rpm: docker-ce-18.09.5-3.el7.x86_64
diff --git a/ansible/test/roles/prepare-helm/defaults/main.yml b/ansible/test/roles/prepare-helm/defaults/main.yml
new file mode 100644
index 00000000..8ab9ed3a
--- /dev/null
+++ b/ansible/test/roles/prepare-helm/defaults/main.yml
@@ -0,0 +1,3 @@
+---
+# 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
new file mode 100644
index 00000000..aa01e281
--- /dev/null
+++ b/ansible/test/roles/prepare-helm/tasks/main.yml
@@ -0,0 +1,18 @@
+---
+- name: "Ensure {{ app_data_path }}/downloads directory exists"
+ file:
+ path: "{{ app_data_path }}/downloads"
+ 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"
+ remote_src: true