Last active
August 15, 2017 18:02
-
-
Save eumel8/6d9422476f6da2e7a84dceb2c125bd55 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: "localhost" | |
gather_facts: no | |
tasks: | |
- name: Search for projects | |
uri: | |
url: "https://translate.openstack.org/rest/projects" | |
method: GET | |
return_content: yes | |
validate_certs: yes | |
headers: | |
Accept: application/json | |
register: projectlist | |
- name: Search for versions | |
uri: | |
url: "https://translate.openstack.org/rest/projects/p/{{ item }}" | |
method: GET | |
return_content: yes | |
validate_certs: yes | |
status_code: 200,201,202,203,204,404 | |
headers: | |
Accept: application/json | |
register: versionlist | |
with_items: | |
- "{{ (projectlist.content|from_json)|json_query('[].id') }}" | |
- name: Set fact versions | |
set_fact: | |
versions: "{{ versionlist|json_query('results[].json[].{ id: id, branch: iterations[].id } ') }}" | |
- name: List projects and versions | |
debug: | |
msg: "{{ versions }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment