Blob Blame History Raw
- hosts: localhost
  vars:
    config:
      artifacts: "{{ lookup('env', 'TEST_ARTIFACTS')|default('./artifacts', true) }}"
      testfilename: fonttest.py
      testfilepath: /usr/local/bin
      logfilepath: /tmp/test.log
      fontname: liberation
      lang: ["en","az-az","de","el","he"]
      
  tags:
  - classic

  remote_user: root

  tasks:
  - name: Install required package
    dnf:
      name: 
      - "{{ config.fontname }}-fonts"
      - python3
      - fontconfig

  - name: Install the test files
    copy: src={{ config.testfilename }} dest={{ config.testfilepath }}/{{ config.testfilename }} mode=0755

  - name: Test Execution
    block:
      - name: Execute the tests
        command: python3 {{ config.testfilepath }}/{{ config.testfilename }} "{{ config }}"

    always:
      - name: Pull out the artifacts
        fetch:
          dest: "{{ config.artifacts }}/"
          src: "{{ item }}"
          flat: yes
        with_items:
          - "{{ config.logfilepath }}"