Skip to content
This repository was archived by the owner on Mar 30, 2025. It is now read-only.

Commit 4531f98

Browse files
author
staticdev
committed
Pycharm new installation
1 parent d1a85f4 commit 4531f98

File tree

3 files changed

+23
-13
lines changed

3 files changed

+23
-13
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ None.
2525
Here is the list of all variables and their default values:
2626

2727
- `install_pycharm`: `false`
28-
- `pycharm_flavor`: `pycharm-community`. You can use also `pycharm-professional` or `pycharm-educational`.
28+
- `pycharm_flavor`: `community`. You can use also `professional` or `edu`
29+
- `pycharm_version`: `2021.1.2`
2930
- `install_vscode`: `false`
3031
- `vscode_extensions`: optional list of name_ids of extensions. eg.: ms-python.python (Python Official Extension)
3132
- `pyenv_global`: optional Python global version for pyenv (from [staticdev.pyenv](https://github.com/staticdev/ansible-galaxy-pyenv))
@@ -50,7 +51,7 @@ Here is the list of all variables and their default values:
5051
- role: staticdev.python-developer
5152
vars:
5253
install_pycharm: true
53-
pycharm_flavor: pycharm-educational
54+
pycharm_flavor: edu
5455

5556
# role with vscode and extensions
5657
- hosts: all

defaults/main.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
---
22
install_pycharm: false
3-
pycharm_flavor: pycharm-community
3+
pycharm_download_url: https://download.jetbrains.com/python/
4+
pycharm_flavor: community
5+
pycharm_install_prefix: /opt
6+
pycharm_version`: 2021.1.2
47
install_vscode: false

tasks/pycharm.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
---
2-
- name: Ensure snap is installed
3-
package:
4-
name: snap
5-
state: present
6-
become: true
2+
- name: Download pycharm
3+
get_url:
4+
url: "{{ pycharm_download_url }}/pycharm-{{ pycharm_flavor }}-{{ pycharm_version }}.tar.gz"
5+
dest: "~/pycharm-{{ pycharm_flavor }}-{{ pycharm_version }}.tar.gz"
6+
owner: root
7+
group: root
8+
mode: 0644
79

8-
- name: Install pycharm
9-
community.general.snap:
10-
name: "{{ pycharm_flavor }}"
11-
classic: true
12-
become: true
10+
- name: Unarchive pycharm
11+
unarchive:
12+
src: "~/pycharm-{{ pycharm_flavor }}-{{ pycharm_version }}.tar.gz"
13+
dest: "{{ pycharm_install_prefix }}"
14+
creates: "{{ pycharm_install_prefix }}/pycharm-{{ pycharm_flavor }}-{{ pycharm_version }}"
15+
copy: false
16+
17+
- name: Run pycharm install script
18+
ansible.builtin.script: "{{ pycharm_install_prefix }}/pycharm-{{ pycharm_flavor }}-{{ pycharm_version }}/bin/pycharm.sh"

0 commit comments

Comments
 (0)