Commit 55b98a07 authored by julian.gethmann's avatar julian.gethmann

Make PyCharm role more idempotent

parent 9a2c331e
--- ---
- 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 - name: download PyCharm
get_url: get_url:
url: "https://download-cf.jetbrains.com/python/{{ pycharm_name }}.tar.gz" url: "https://download-cf.jetbrains.com/python/{{ pycharm_name }}.tar.gz"
dest: /tmp/pycharm.tar.gz dest: "{{ tmpdir.path }}/pycharm.tar.gz"
when: tmpdir.changed
- name: create directory - name: Create directory
become: yes become: yes
file: file:
path: /usr/local/pycharm path: /usr/local/pycharm
state: directory state: directory
- name: unarchive - name: Unarchive
become: yes become: yes
unarchive: unarchive:
src: /tmp/pycharm.tar.gz src: /tmp/pycharm.tar.gz
...@@ -18,7 +30,7 @@ ...@@ -18,7 +30,7 @@
remote_src: yes remote_src: yes
creates: "/usr/local/pycharm/{{ pycharm_name | regex_replace('-professional') }}" creates: "/usr/local/pycharm/{{ pycharm_name | regex_replace('-professional') }}"
- name: link PyCharm - name: Link PyCharm
become: yes become: yes
file: file:
mode: o+rx mode: o+rx
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment