This role will download, extract and configure any number of Jetbrains PyCharm.
There are no requirements nor dependencies.
Before the role can be used it needs to be added to the machine running the playbook, and as of writing this, this role is not hosted on Ansible-Galaxy only on Github.
-
Create a requirements.yml file in the root directory of the playbook being worked on.
-
Add the following definition inside the requirements.yml file:
- name: hth-jetbrains-pycharm
src: https://github.com/hrafnthor/ansible-jetbrains-pycharm.git
scm: git
- Install the requirements by executing
ansible-galaxy install -r .requirements.yml
This will allow any playbook run from this machine to use the role hth-jetbrains-pycharm
All variables are optional unless otherwise stated.
pycharm_path
: [string]: (required) The path at which pycharm clients will be extracted to. Uses the client edition
and version
in determining the directory to extract to. Defaults to /opt/jetbrains/pycharm
When extracting a community edition of pycharm with version 2020.2.2 the path will be:
<pycharm_path>/community/2020.2.2/
clients
[array]: Contains a list of client definitions that will be downloaded and extracted onto the host machine. While not required by the role, it will not do much unless given a list of clients to process.
Information on each available client can be found at Jetbrains archive here.
There are a few fields that each object can have, and they are:
-
version
: [string] (required) the version number of the IDE -
checksum
: [string] (required) the checksum of the archive being downloaded- the checksum can be gotten by navigating to the download url of the archive and appending
.sha256
to the url. For examplehttps://download.jetbrains.com/python/pycharm-community-2022.3.2.tar.gz.sha256
.
- the checksum can be gotten by navigating to the download url of the archive and appending
-
edition: [enum] (required) the edition of the IDE. Can either be
community
orprofessional
-
desktop: [boolean] Indicates if a desktop entry should be created for the IDE.
cli
[object]: Contains information about what client type and version should be added to the path via a symlink to /usr/bin.
The object contains the following fields:
edition
[enum]: (required) The edition of the IDE. Eithercommunity
orprofessional
.version
[String]: (required) The version of the editor that should be linked.
Here is an example for downloading two different versions of the IDE, where one will have a desktop entry created while the other one will not.
- hosts: all
vars:
- pycharm:
clients:
- version: "2022.3.2"
checksum: "0ae72d1931a6effbeb2329f6e5c35859d933798a494479f066ef0a7b2be6b553"
edition: community
desktop: false
- version: "2022.3.2"
checksum: "56430090dd471e106fdc48463027d89de624759f8757248ced9776978854e4f6"
edition: professional
desktop: true
cli:
edition: community
version: "2022.3.2"
roles:
- hth-jetbrains-pycharm
Apache License 2.0. See attached license file.
Hrafn Thorvaldsson. http://www.hth.is