Skip to content

Commit e147ca5

Browse files
Initial import
0 parents  commit e147ca5

File tree

10 files changed

+242
-0
lines changed

10 files changed

+242
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea/

.travis.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
language: python
3+
python: "2.7"
4+
5+
# Use the new container infrastructure
6+
sudo: false
7+
8+
# Install ansible
9+
addons:
10+
apt:
11+
packages:
12+
- python-pip
13+
14+
install:
15+
# Install ansible
16+
- pip install ansible
17+
18+
# Check ansible version
19+
- ansible --version
20+
21+
# Create ansible.cfg with correct roles_path
22+
- printf '[defaults]\nroles_path=../' >ansible.cfg
23+
24+
script:
25+
# Basic role syntax check
26+
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
27+
28+
notifications:
29+
webhooks: https://galaxy.ansible.com/api/v1/notifications/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 Henrik Lynggaard Hansen
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
IntelliJ
2+
=========
3+
4+
This role installs intellij and configured plugins. It has been tested on Linux Mint 18 but should wokr on most
5+
distributions. By default it installs IntelliJ community edition 2017.1.1 and no additional plugins
6+
7+
By default intellij is installed under the user's home directory and _become_ is not needed.
8+
9+
Requirements
10+
------------
11+
12+
None
13+
14+
15+
Role Variables
16+
--------------
17+
18+
intellij_version: 2017.1.1
19+
intellij_edition: community
20+
intellij_download_mirror: https://download.jetbrains.com/python/
21+
intellij_plugin_download_mirror: "https://plugins.jetbrains.com/plugin/download?updateId="
22+
intellij_plugins: []
23+
intellij_download_directory: /tmp
24+
intellij_install_directory: "{{ ansible_env['HOME'] }}/Tools"
25+
26+
intellij_install_file: "intellij-{{ intellij_edition}}-{{ intellij_version }}.tar.gz"
27+
intellij_download_url: "{{ intellij_download_mirror }}{{ intellij_install_file }}"
28+
intellij_location: "{{ intellij_install_directory }}/intellij-{{ intellij_edition }}-{{ intellij_version }}"
29+
intellij_desktop_file_location: "{{ ansible_env['HOME'] }}/.local/share/applications/intellij-{{ intellij_edition }}-{{ intellij_version }}.desktop"
30+
31+
32+
intellij_plugins is a list of names which get appended to intellij_plugin_download_mirror to form a full download
33+
34+
35+
Dependencies
36+
------------
37+
38+
None
39+
40+
Example
41+
-------
42+
43+
__Example playbook__
44+
45+
46+
- hosts: localhost
47+
connection: local
48+
49+
roles:
50+
- henriklyngaard.intellij
51+
52+
__Exmaple inventory for plugins__
53+
54+
The below IDs have been found by going to https://plugins.jetbrains.com/intellij and searching for the plugin.
55+
Once found copy the link location for the desired version and use the _updateId=XXXXX_ part at the end
56+
57+
intellij_plugins:
58+
# ignore 1.7.6
59+
- 32828
60+
# bash support 1.6.5.171
61+
- 31610
62+
# ansible 0.9.4
63+
- 27616
64+
# docker 2.5.3
65+
- 33621
66+
# markdown 2017.1.20170302
67+
- 33092
68+
69+
Alternatively upload the required plugins to a webserver and adjust _intellij_plugin_download_mirror_ and
70+
_intellij_plugins_ accordingly
71+
72+
73+
License
74+
-------
75+
76+
MIT
77+
78+
Change log
79+
----------
80+
81+
* 1.0: Initial version

defaults/main.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
intellij_version: 2017.1.1
3+
intellij_edition: community
4+
intellij_download_mirror: "https://download.jetbrains.com/idea/"
5+
intellij_plugin_download_mirror: "https://plugins.jetbrains.com/plugin/download?updateId="
6+
intellij_plugins: []
7+
intellij_download_directory: /tmp
8+
intellij_install_directory: "{{ ansible_env['HOME'] }}/Tools"
9+
10+
intellij_install_file: "idea{{ intellij_edition_short }}-{{ intellij_version }}.tar.gz"
11+
intellij_download_url: "{{ intellij_download_mirror }}{{ intellij_install_file }}"
12+
intellij_location: "{{ intellij_install_directory }}/intellij-{{ intellij_edition }}-{{ intellij_version }}"
13+
intellij_desktop_file_location: "{{ ansible_env['HOME'] }}/.local/share/applications/intellij-{{ intellij_edition }}-{{ intellij_version }}.desktop"
14+

meta/main.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
galaxy_info:
2+
author: Henrik Lynggaard Hansen
3+
description: Installs IntelliJ and plugins
4+
5+
license: MIT
6+
7+
min_ansible_version: 2.1
8+
9+
platforms:
10+
- name: Ubuntu
11+
versions:
12+
- trusty
13+
14+
galaxy_tags:
15+
- jetbrains
16+
- workstation
17+
- ide
18+
- java
19+
20+
dependencies: []

tasks/main.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
3+
- name: Set facts
4+
set_fact:
5+
intellij_edition_short: "{{ item.short }}"
6+
with_items:
7+
- short: IC
8+
long: community
9+
- short: IU
10+
long: ultimate
11+
when: intellij_edition == item.long
12+
13+
- name: Create directories for IntelliJ
14+
file:
15+
path: "{{ item }}"
16+
state: directory
17+
with_items:
18+
- "{{ intellij_download_directory }}"
19+
- "{{ intellij_install_directory }}"
20+
21+
- name: Download IntelliJ
22+
get_url:
23+
url: "{{ intellij_download_url}}"
24+
dest: "{{ intellij_download_directory }}"
25+
register: intellij_installer
26+
27+
- name: Download IntelliJ plugins
28+
get_url:
29+
url: "{{ intellij_plugin_download_mirror }}{{ item }}"
30+
dest: "{{ intellij_download_directory }}"
31+
register: intellij_plugins
32+
with_items: "{{ intellij_plugins }}"
33+
34+
- name: Install IntelliJ
35+
unarchive:
36+
src: "{{ intellij_installer.dest }}"
37+
dest: "{{ intellij_download_directory }}"
38+
list_files: yes
39+
register: unarchive_intellij
40+
41+
- name: Find IntelliJ build number
42+
set_fact:
43+
intellij_buildnumber: "{{ unarchive_intellij.files[0].split('/')[0] }}"
44+
45+
- debug:
46+
msg: "Build number: {{ intellij_buildnumber }}"
47+
48+
- name: Move to final location
49+
command: mv {{ intellij_download_directory }}/{{ intellij_buildnumber }} {{ intellij_location }}
50+
51+
- name: Install IntelliJ Plugins
52+
unarchive:
53+
src: "{{ item.dest }}"
54+
dest: "{{ intellij_location }}/plugins"
55+
with_items: "{{ intellij_plugins.results }}"
56+
57+
- name: Create IntelliJ desktop entry
58+
template:
59+
src: intellij.desktop.j2
60+
dest: "{{ intellij_desktop_file_location }}"

templates/intellij.desktop.j2

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[Desktop Entry]
2+
Version=1.0
3+
Type=Application
4+
Name=IntelliJ {{ intellij_edition.title() }} Edition {{ intellij_version.split('-')[-1] }}
5+
Icon={{ intellij_location}}/bin/idea.png
6+
Exec="{{intellij_location }}/bin/idea.sh" %f
7+
Comment=Develop with pleasure!
8+
Categories=Development;IDE;
9+
Terminal=false
10+
StartupWMClass=jetbrains-intellij-ce

tests/inventory

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
localhost

tests/test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
- hosts: localhost
3+
remote_user: root
4+
roles:
5+
- ../../

0 commit comments

Comments
 (0)