Hi Miro,

I cannot help with the ansible magic but if you do not have STI as a hard requirement I think there might be a relatively straightforward way to cover your use case using tmt as it allows to set an environment variable for the whole plan. Your rpms/python3.11 config could look like this:

    how: fmf
    url: https://src.fedoraproject.org/tests/python
    filter: component:python311
    how: install
      - python3.11
      - python3.11-test
      - python3.11-tkinter
    VERSION: "3.11"
    how: tmt

In this way you would specify the python version and the proper package list only once. The test metadata could be shared from the tests namespace, no need to repeat the list again and again in individual rpms namespace branches. I've outlined a simple setup in the following pull request:


If this sounds like a viable solution feel free to ping me or anybody on the #tmt channel for details. We'll be glad to help you with the config.


On Wed, 22 Jun 2022 at 12:56, Miro Hrončok <mhroncok@redhat.com> wrote:

please bare with me because my Ansible skills are close to none. I only use it
for Fedora CI.

I've read

I have this (simplified) tests.yml:

     - hosts: localhost
       - role: standard-test-basic
         - smoke:
             dir: python/smoke
             run: VERSION=3.11 ./venv.sh
         - python3.11
         - python3.11-devel

Full version in

I would like to replace all occurrences of 3.11 with a variable:

     - hosts: localhost
       - role: standard-test-basic
         - smoke:
             dir: python/smoke
             run: VERSION={{ pybasever }} ./venv.sh
         - python{{ pybasever }}
         - python{{ pybasever }}-devel

But where do I put pybasever: '3.11' exactly?

Bonus question: Can I read the tested package name and regex it into the variable?

     pybasever:  {{ xxx_package_name|pex_regex_replace('^python', '') }}

Miro Hrončok
Phone: +420777974800
IRC: mhroncok
CI mailing list -- ci@lists.fedoraproject.org
To unsubscribe send an email to ci-leave@lists.fedoraproject.org
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/ci@lists.fedoraproject.org
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure