Add IntelliJ Idea
This commit is contained in:
parent
42fb5c5e81
commit
bd4fa1fd4c
@ -14,3 +14,4 @@
|
|||||||
- ego
|
- ego
|
||||||
- laptop
|
- laptop
|
||||||
- prusa-slicer
|
- prusa-slicer
|
||||||
|
- intellij
|
||||||
|
49
roles/intellij/tasks/main.yml
Normal file
49
roles/intellij/tasks/main.yml
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
- name: install jmespath for json_query
|
||||||
|
become: yes
|
||||||
|
apt:
|
||||||
|
update_cache: yes
|
||||||
|
pkg:
|
||||||
|
- python3-jmespath
|
||||||
|
|
||||||
|
- name: "Get IntelliJ version"
|
||||||
|
uri:
|
||||||
|
url: https://data.services.jetbrains.com/products/releases?code=IIU
|
||||||
|
body_format: json
|
||||||
|
register: idea_info
|
||||||
|
|
||||||
|
- debug: msg="{{ idea_info.json | json_query('IIU[0].downloads.linux.link') }}"
|
||||||
|
|
||||||
|
- name: Create temp dir
|
||||||
|
file:
|
||||||
|
path: "{{ tmp_dir }}"
|
||||||
|
state: directory
|
||||||
|
|
||||||
|
- name: "Download IntelliJ Ultimate"
|
||||||
|
become: yes
|
||||||
|
unarchive:
|
||||||
|
src: "{{ idea_info.json | json_query('IIU[0].downloads.linux.link') }}"
|
||||||
|
dest: "{{ tmp_dir }}"
|
||||||
|
remote_src: yes
|
||||||
|
|
||||||
|
- name: get folder name
|
||||||
|
shell: ls "{{ tmp_dir }}"
|
||||||
|
register: dir_name
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- name: Copy to final directory
|
||||||
|
become: yes
|
||||||
|
command: "cp -ra {{ tmp_dir }}/{{ dir_name.stdout }} {{ idea_dir }}"
|
||||||
|
|
||||||
|
- name: Remove temp directory
|
||||||
|
become: yes
|
||||||
|
file:
|
||||||
|
path: "{{ tmp_dir }}"
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Create symbolic link
|
||||||
|
become: yes
|
||||||
|
file:
|
||||||
|
src: "/opt/idea/bin/idea.sh"
|
||||||
|
dest: "/usr/local/bin/idea"
|
||||||
|
state: link
|
3
roles/intellij/vars/main.yml
Normal file
3
roles/intellij/vars/main.yml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
tmp_dir: /tmp/idea
|
||||||
|
idea_dir: /opt/idea
|
Loading…
Reference in New Issue
Block a user