summaryrefslogtreecommitdiffstats
path: root/ansible/roles
diff options
context:
space:
mode:
authorMichal Zegan <m.zegan@samsung.com>2019-05-22 15:52:37 +0200
committerMichal Zegan <m.zegan@samsung.com>2019-05-22 18:08:06 +0200
commitf2b9a04b5bc1f8c22cba4ba587f0526306d92ac8 (patch)
tree0a7d77578803383c90e4c08b401a922a142050e4 /ansible/roles
parentb1fe78553ea7d1caf90c1d52e195cd8f2a082008 (diff)
Make molecule tests for certificates independent from docker role
Currently molecule tests for certificates role call the docker role just to make one handler available. It actually breaks best practices of unit testing, the docker role shouldn't be called nor tested in unit test of certificates role. This commit makes certificates role independent by just creating fake handlers. Change-Id: Iec7934c7c1f4e9b37ff523e1d86a3beaaa88bdcf Issue-ID: OOM-1864 Signed-off-by: Michal Zegan <m.zegan@samsung.com>
Diffstat (limited to 'ansible/roles')
-rw-r--r--ansible/roles/certificates/molecule/default/playbook.yml9
-rw-r--r--ansible/roles/certificates/molecule/default/prepare.yml5
2 files changed, 6 insertions, 8 deletions
diff --git a/ansible/roles/certificates/molecule/default/playbook.yml b/ansible/roles/certificates/molecule/default/playbook.yml
index 5dcd42ee..13583ebb 100644
--- a/ansible/roles/certificates/molecule/default/playbook.yml
+++ b/ansible/roles/certificates/molecule/default/playbook.yml
@@ -1,14 +1,17 @@
---
- name: Infra
hosts: infrastructure
+ handlers:
+ - name: Restart Docker
+ debug: msg="Docker restart called"
roles:
- certificates
- - docker # docker role needed here just because of docker restart handler
- name: Kube
hosts: kubernetes
- roles:
- - docker # docker role needed here just because of docker restart handler
+ handlers:
+ - name: Restart Docker
+ debug: msg="Docker restart called"
tasks:
- include_role:
name: certificates
diff --git a/ansible/roles/certificates/molecule/default/prepare.yml b/ansible/roles/certificates/molecule/default/prepare.yml
deleted file mode 100644
index 8df759c9..00000000
--- a/ansible/roles/certificates/molecule/default/prepare.yml
+++ /dev/null
@@ -1,5 +0,0 @@
----
-- name: Prepare infra
- hosts: all
- roles:
- - prepare-docker