| |
@@ -0,0 +1,34 @@
|
| |
+ ---
|
| |
+ - name: Add executor host
|
| |
+ add_host:
|
| |
+ name: executor
|
| |
+ ansible_connection: local
|
| |
+ ansible_ssh_host: 127.0.0.1
|
| |
+ ansible_ssh_connection: local
|
| |
+
|
| |
+ - name: Extract package source code
|
| |
+ delegate_to: executor
|
| |
+ block:
|
| |
+ - name: Gather facts
|
| |
+ setup:
|
| |
+ delegate_facts: True
|
| |
+
|
| |
+ - name: Install requirements
|
| |
+ package: name={{item}} state=present
|
| |
+ with_items:
|
| |
+ - fedpkg
|
| |
+
|
| |
+ # The dist doesn't actually matter here
|
| |
+ - name: Download sources, extract, and strip leading path
|
| |
+ shell: |
|
| |
+ set -e
|
| |
+ rm -rf {{ srcdir }}
|
| |
+ fedpkg --release=master prep --builddir={{ srcdir }}
|
| |
+ args:
|
| |
+ chdir: "{{playbook_dir}}/.."
|
| |
+
|
| |
+ - name: Flatten sources
|
| |
+ shell: |
|
| |
+ shopt -s dotglob
|
| |
+ mv {{ srcdir }}/*/* {{ srcdir }}
|
| |
+ when: flatten
|
| |
This logic is used when invoking tests that are packaged in the
upstream tarball or sources. It is a technique used by the rpm-ostree
and cockpit tests.
Put this role in your tests.yml playbook. The playbook
will extract the upstream source tarball as described in
the package spec file into a test/source/ directory. You
can then use or execute files (usually tests) from the
upstream sources in your playbook.
You can redefine the following variables:
to {{ playbook_dir }}/source/