Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support installing the latest version #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ None

#### Variables

* `pycharm_version` [default: `4.5.5`]: Version to install
* `pycharm_version` [default: `latest`]: Version to install (e.g. `4.5.5` or `latest`)
* `pycharm_edition` [default: `professional`]: Edition to install (e.g. `community`)
* `pycharm_install_prefix` [default: `/opt`]: Install prefix

Expand Down
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# defaults file for pycharm
---
pycharm_version: 4.5.5
pycharm_version: 'latest' # 'latest' or e.g. '4.5.5' or '2016.2.3'
pycharm_edition: professional
pycharm_install_prefix: /opt
18 changes: 18 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,24 @@
- pycharm
- pycharm-download

- name: Find latest version
uri:
url: "http://data.services.jetbrains.com/products/releases?code=PCP%2CPCC&latest=true&type=release"
return_content: yes
body_format: json
register: releases_response
when: pycharm_version == 'latest'

- name: "Set pycharm_version to latest community version (if edition==community)"
set_fact:
pycharm_version: "{{ releases_response.json.PCC.0.version }}"
when: pycharm_version == 'latest' and pycharm_edition == 'community'

- name: "Set pycharm_version to latest professional version (if edition==professional)"
set_fact:
pycharm_version: "{{ releases_response.json.PCP.0.version }}"
when: pycharm_version == 'latest' and pycharm_edition == 'professional'

- name: download
get_url:
url: "http://download.jetbrains.com/python/pycharm-{{ pycharm_edition }}-{{ pycharm_version }}.tar.gz"
Expand Down