diff --git a/validations_libs/ansible.py b/validations_libs/ansible.py index 71671ebb..38b81fc8 100644 --- a/validations_libs/ansible.py +++ b/validations_libs/ansible.py @@ -20,6 +20,7 @@ import os import six import sys import tempfile +import uuid import yaml from six.moves import configparser @@ -297,7 +298,8 @@ class Ansible(object): command_path = None - with utils.TempDirs(chdir=False) as ansible_artifact_path: + with utils.TempDirs(dir_path=constants.VALIDATION_RUN_LOG_PATH, + chdir=False,) as ansible_artifact_path: if 'ANSIBLE_CONFIG' not in env and not ansible_cfg: ansible_cfg = os.path.join(ansible_artifact_path, 'ansible.cfg') config = configparser.ConfigParser() diff --git a/validations_libs/constants.py b/validations_libs/constants.py index 67231897..be27233e 100644 --- a/validations_libs/constants.py +++ b/validations_libs/constants.py @@ -12,8 +12,6 @@ # License for the specific language governing permissions and limitations # under the License. # - - DEFAULT_VALIDATIONS_BASEDIR = '/usr/share/validations-common' ANSIBLE_VALIDATION_DIR = '/usr/share/validations-common/playbooks' @@ -23,3 +21,5 @@ VALIDATION_GROUPS_INFO = '%s/groups.yaml' % DEFAULT_VALIDATIONS_BASEDIR VALIDATION_GROUPS = ['no-op', 'prep', 'post'] + +VALIDATION_RUN_LOG_PATH = '/var/lib/validations/logs' diff --git a/validations_libs/run.py b/validations_libs/run.py index 81ec611e..5569cfec 100644 --- a/validations_libs/run.py +++ b/validations_libs/run.py @@ -32,7 +32,7 @@ class Run(object): def run_validations(self, playbook, inventory, group=None, extra_vars=None, validations_dir=None, validation_name=None, extra_env_var=None, - ansible_cfg=None): + ansible_cfg=None, quiet=True): self.log = logging.getLogger(__name__ + ".run_validations") @@ -71,7 +71,7 @@ class Run(object): parallel_run=True, inventory=inventory, output_callback='validation_json', - quiet=True, + quiet=quiet, extra_vars=extra_vars, extra_env_variables=extra_env_var, ansible_cfg=ansible_cfg,