summaryrefslogtreecommitdiffstats
path: root/ansible/test/roles/prepare-docker/tasks/main.yml
diff options
context:
space:
mode:
authorSamuli Silvius <s.silvius@partner.samsung.com>2019-03-25 18:46:24 +0200
committerSamuli Silvius <s.silvius@partner.samsung.com>2019-04-16 11:33:43 +0000
commitbf6776cc01865b8ba392fdbec18e28bf2a362b05 (patch)
tree0a68ae8b859984f1fd8d21c58f456e53d7e7d8b1 /ansible/test/roles/prepare-docker/tasks/main.yml
parente3c829675916391011e86ee78a404570b99bc51a (diff)
Molecule tests for docker role
Issue-ID: OOM-1759 Change-Id: I9e1ee7f248147b3f7229625c7a20fa84e8e67aac Signed-off-by: Samuli Silvius <s.silvius@partner.samsung.com>
Diffstat (limited to 'ansible/test/roles/prepare-docker/tasks/main.yml')
-rw-r--r--ansible/test/roles/prepare-docker/tasks/main.yml21
1 files changed, 21 insertions, 0 deletions
diff --git a/ansible/test/roles/prepare-docker/tasks/main.yml b/ansible/test/roles/prepare-docker/tasks/main.yml
new file mode 100644
index 00000000..e7d87061
--- /dev/null
+++ b/ansible/test/roles/prepare-docker/tasks/main.yml
@@ -0,0 +1,21 @@
+---
+- 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