--- - name: check if PyCharm is installed stat: path: "/usr/local/pycharm/{{ pycharm_name | regex_replace('-professional') }}" register: pycharm_installation - name: create temporary download directory tempfile: state: directory register: tmpdir when: not (pycharm_installation.stat.isdir is defined and pycharm_installation.stat.isdir) - name: download PyCharm get_url: url: "https://download-cf.jetbrains.com/python/{{ pycharm_name }}.tar.gz" dest: "{{ tmpdir.path }}/pycharm.tar.gz" when: tmpdir.changed - name: Create directory become: yes file: path: /usr/local/pycharm state: directory - name: Unarchive become: yes unarchive: src: /tmp/pycharm.tar.gz dest: /usr/local/pycharm remote_src: yes creates: "/usr/local/pycharm/{{ pycharm_name | regex_replace('-professional') }}" - name: Link PyCharm become: yes file: mode: o+rx path: /usr/local/bin/pycharm src: "/usr/local/pycharm/{{ pycharm_name | regex_replace('-professional') }}/bin/pycharm.sh" state: link - name: Add Desktop-icon template: src: PyCharm.desktop.j2 dest: "/home/{{ user_account }}/Desktop/PyCharm.desktop" backup: yes owner: "{{ user_account }}"