python-pidfile/tests/test_playbook.yml
2022-10-13 13:12:31 +05:30

28 lines
742 B
YAML

- hosts: localhost
vars:
config:
packagename: python-pidfile
testfilename: test_pidfile.py
logfilepath: /tmp/test.log
artifacts: "{{ lookup('env', 'TEST_ARTIFACTS')|default('./artifacts', true) }}"
tags:
- classic
remote_user: root
tasks:
- name: Install required package
dnf:
name:
- "{{ config.packagename }}"
- python3
- name: Test Execution
block:
- name: Execute the tests
command: python3 {{ config.testfilename }} {{ logfilepath }}
always:
- name: Pull out the artifacts
fetch:
dest: "{{ config.artifacts }}/"
src: "{{ item }}"
flat: yes
with_items:
- "{{ config.logfilepath }}"