main.yml 1 KB
Newer Older
julian.gethmann's avatar
julian.gethmann committed
1
---
2
- name: create directory
julian.gethmann's avatar
julian.gethmann committed
3 4
  become: yes
  file:
5
    path: /usr/local/pycharm
julian.gethmann's avatar
julian.gethmann committed
6 7
    state: directory

8
- name: unarchive
julian.gethmann's avatar
julian.gethmann committed
9 10
  become: yes
  unarchive:
11
    src: "https://download-cf.jetbrains.com/python/{{ pycharm_name }}.tar.gz"
12
    dest: /usr/local/pycharm
julian.gethmann's avatar
julian.gethmann committed
13
    remote_src: yes
14
    creates: "/usr/local/pycharm/{{ pycharm_name | regex_replace('-professional') }}"
15

16
- name: link PyCharm
17 18 19 20
  become: yes
  file:
    mode: o+rx
    path: /usr/local/bin/pycharm
21
    src: "/usr/local/pycharm/{{ pycharm_name | regex_replace('-professional') }}/bin/pycharm.sh"
22
    state: link
julian.gethmann's avatar
julian.gethmann committed
23
  register: new_version
julian.gethmann's avatar
julian.gethmann committed
24

25
- name: add Desktop-icon
julian.gethmann's avatar
julian.gethmann committed
26 27 28 29 30
  template:
    src: PyCharm.desktop.j2
    dest: "/home/{{ user_account }}/Desktop/PyCharm.desktop"
    backup: yes
    owner: "{{ user_account }}"
31 32
    group: users
    mode: 0744
33
  ignore_errors: yes
julian.gethmann's avatar
julian.gethmann committed
34 35 36 37 38 39 40 41

- name: uninstalled old versions
  become: yes
  file:
    state: absent
    path: "/usr/local/pycharm/{{ item | regex_replace('-professional') }}"
  with_items: "{{ old_versions }}"
  when: new_version.changed