- 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') }}" when: local_version_inf_file is defined - name: "Set version info fact" set_fact: local_intellij_version: "0.0" upstream_intellij_version: "{{ idea_info.json | json_query('IIU[0].version') }}" when: local_version_inf_file is undefined - import_tasks: install.yml when: local_version_info_file is undefined or local_intellij_version != upstream_intellij_version