From 8196204885c8b2c7aae8b68eec9c4349e1706ca7 Mon Sep 17 00:00:00 2001 From: Tomas Tomecek Date: Jan 04 2019 11:22:50 +0000 Subject: fix invocation of tests * correctly define the inv file * use include (static) over import (dynamic) * use systemctl to detect if we are in a cont Signed-off-by: Tomas Tomecek --- diff --git a/tests/inventory-localhost b/tests/inventory-localhost index 2fbb50c..2302eda 100644 --- a/tests/inventory-localhost +++ b/tests/inventory-localhost @@ -1 +1 @@ -localhost +localhost ansible_connection=local diff --git a/tests/tests.yml b/tests/tests.yml index 511e457..ca82d2d 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -4,15 +4,15 @@ hosts: all tasks: - name: check if we are running in a container - stat: - path: /.dockerenv - register: in_docker_cont + command: systemctl + register: in_host + ignore_errors: true - name: add docker to req_services if we are not in a dkr cont set_fact: req_services: ["docker"] - when: not in_docker_cont.stat.exists + when: in_host.rc == 0 - name: run them tests - import_role: + include_role: name: standard-test-basic tags: - classic