Skip to content

Commit

Permalink
Read version string from JSON object of occ status (#28)
Browse files Browse the repository at this point in the history
Read version string from JSON object of occ status
  • Loading branch information
nkakouros authored Nov 3, 2019
2 parents 273d26d + cf7b07b commit 31364c1
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions tasks/core/apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,24 @@
- name: Install external apps
block:
- name: Find full nextcloud version
command: ./occ -V
command: ./occ status --output=json
args:
chdir: "{{ nextcloud_installation_dir }}"
become: true
become_user: "{{ nextcloud_file_owner }}"
register: nextcloud_full_version
register: _result
changed_when: false

- name: Remove non-json text from command output
set_fact:
nextcloud_full_version:
"{{ (_result.stdout | from_json)['versionstring'] }}"

- name: Create app json file url
set_fact:
nextcloud_app_store_json_url: >-
https://apps.nextcloud.com/api/v1/platform/{{
nextcloud_full_version.stdout_lines[-1]
| regex_replace(
'.* ([0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2})$',
'\1'
)
nextcloud_full_version
}}/apps.json
changed_when: false

Expand Down

0 comments on commit 31364c1

Please sign in to comment.