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>
diff --git a/ansible/roles/certificates/molecule/default/playbook.yml b/ansible/roles/certificates/molecule/default/playbook.yml
index 5dcd42e..13583eb 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