From f770cc2bf164993931d1e07d111c03abc8ec5ef9 Mon Sep 17 00:00:00 2001 From: Miroslav Vadkerti Date: Jul 16 2021 12:33:51 +0000 Subject: roles/testing-farm-run-test: fix body of the request We need to provide the request as a valid JSON. Also hid the request as it contains sensitive information. Signed-off-by: Miroslav Vadkerti --- diff --git a/roles/testing-farm-run-test/tasks/main.yml b/roles/testing-farm-run-test/tasks/main.yml index df5ffce..0da307d 100644 --- a/roles/testing-farm-run-test/tasks/main.yml +++ b/roles/testing-farm-run-test/tasks/main.yml @@ -5,25 +5,35 @@ method: POST body_format: json body: | - api_key: "{{ testing_farm_zuul_fedora_ci_key.apikey }}" - test: - fmf: - url: "https://src.fedoraproject.org/{{ zuul.project.name }}" - ref: "{{ zuul.ref }}" - environments: - - os: - compose: "{{ compose }}" - arch: x86_64 - artifacts: - {% for repo in zuul.artifacts %} - {% if repo.name == 'repo' %} - - type: "repository" - id: "{{ repo.url }}" - {% endif %} - {% endfor %} + { + "api_key": "{{ testing_farm_zuul_fedora_ci_key.apikey }}", + "test": { + "fmf": { + "url": "https://src.fedoraproject.org/{{ zuul.project.name }}", + "ref": "{{ zuul.ref }}" + } + }, + "environments": [{ + "arch": "x86_64", + "os": { + "compose": "{{ compose }}", + }, + "artifacts": [ + {%- for repo in zuul.artifacts -%} + {%- if repo.name == 'repo' -%} + { + "type": "repository", + "id": "{{ repo.url }}" + }{%- if not loop.last -%},{%- endif -%} + {%- endif -%} + {%- endfor -%} + ] + }] + } status_code: 200, 201 timeout: 30 register: id + no_log: true - debug: msg: "Request URL: {{ api_url }}/requests/{{ id.json.id }}"