ansible-desktop/roles/intellij/tasks/main.yml
2023-06-02 13:51:13 +02:00

25 lines
811 B
YAML

- name: "Get IntelliJ version"
uri:
url: https://data.services.jetbrains.com/products/releases?code=IIU
body_format: json
register: idea_info
- name: "Check if intellij is installed"
stat:
path: "{{idea_dir}}/product-info.json"
register: local_version_info_file
- name: "Check installed version"
when:
- local_version_info_file.stat.exists
shell: cat {{idea_dir}}/product-info.json
register: local_version_info_file
- name: "Set version info fact"
set_fact:
local_intellij_version: "{{ local_version_info_file.stdout | from_json | json_query('version') }}"
upstream_intellij_version: "{{ idea_info.json | json_query('IIU[0].version') }}"
- import_tasks: install.yml
when: local_version_info_file is undefined or local_intellij_version != upstream_intellij_version