Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ansible): install jetbrains toolbox on linux
Install the latest version of jetbrains toolbox on Linux with this ansible-role.
- Loading branch information
1 parent
445c19f
commit 55730dc
Showing
6 changed files
with
88 additions
and
46 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
"""Sort complex versions""" | ||
|
||
from distutils.version import LooseVersion | ||
|
||
|
||
def filter_sort_versions(value): | ||
""" | ||
Ansible entrypoint function | ||
""" | ||
return sorted(value, key=LooseVersion) | ||
|
||
|
||
class FilterModule(object): | ||
""" | ||
Sort complex versions like 0.10.2, 0.1.1, 0.10.12 | ||
""" | ||
filter_sort = { | ||
'sort_versions': filter_sort_versions, | ||
} | ||
|
||
def filters(self): | ||
""" | ||
Return the sorted values | ||
""" | ||
return self.filter_sort |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,37 @@ | ||
galaxy_info: | ||
author: your name | ||
description: your role description | ||
company: your company (optional) | ||
role_name: jetbrains_toolbox | ||
author: diodonfrost | ||
company: diodonfrost | ||
description: Ansible role for install JetBrains Toolbox | ||
license: license Apache | ||
|
||
# If the issue tracker for your role is not on github, uncomment the | ||
# next line and provide a value | ||
# issue_tracker_url: http://example.com/issue/tracker | ||
min_ansible_version: "2.10" | ||
|
||
# Choose a valid license ID from https://spdx.org - some suggested licenses: | ||
# - BSD-3-Clause (default) | ||
# - MIT | ||
# - GPL-2.0-or-later | ||
# - GPL-3.0-only | ||
# - Apache-2.0 | ||
# - CC-BY-4.0 | ||
license: license (GPL-2.0-or-later, MIT, etc) | ||
platforms: | ||
- name: EL | ||
versions: | ||
- all | ||
- name: Fedora | ||
versions: | ||
- all | ||
- name: Debian | ||
versions: | ||
- all | ||
- name: Ubuntu | ||
versions: | ||
- all | ||
- name: opensuse | ||
versions: | ||
- all | ||
- name: ArchLinux | ||
versions: | ||
- all | ||
- name: Gentoo | ||
versions: | ||
- all | ||
|
||
min_ansible_version: 2.1 | ||
|
||
# If this a Container Enabled role, provide the minimum Ansible Container version. | ||
# min_ansible_container_version: | ||
|
||
# | ||
# Provide a list of supported platforms, and for each platform a list of versions. | ||
# If you don't wish to enumerate all versions for a particular platform, use 'all'. | ||
# To view available platforms and versions (or releases), visit: | ||
# https://galaxy.ansible.com/api/v1/platforms/ | ||
# | ||
# platforms: | ||
# - name: Fedora | ||
# versions: | ||
# - all | ||
# - 25 | ||
# - name: SomePlatform | ||
# versions: | ||
# - all | ||
# - 1.0 | ||
# - 7 | ||
# - 99.99 | ||
|
||
galaxy_tags: [] | ||
# List tags for your role here, one per line. A tag is a keyword that describes | ||
# and categorizes the role. Users find roles by searching for tags. Be sure to | ||
# remove the '[]' above, if you add tags to this list. | ||
# | ||
# NOTE: A tag is limited to a single word comprised of alphanumeric characters. | ||
# Maximum 20 tags per role. | ||
galaxy_tags: | ||
- packaging | ||
- jetbrains | ||
|
||
dependencies: [] | ||
# List your role dependencies here, one per line. Be sure to remove the '[]' above, | ||
# if you add dependencies to this list. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
--- | ||
# tasks file for ansible-role-jetbrains-toolbox | ||
|
||
- name: Include OS specific variables. | ||
ansible.builtin.include_vars: "{{ ansible_system }}.yml" | ||
|
||
- name: Install JetBrains Toolbox | ||
ansible.builtin.include_tasks: "setup-{{ base_os[ansible_system] | default('Linux-Unix') }}.yml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
|
||
- name: Linux/Unix | Find all versions of JetBrains Toolbox | ||
ansible.builtin.uri: | ||
url: https://data.services.jetbrains.com/products/releases?code=TBA&type=release | ||
return_content: yes | ||
register: jetbrains_index | ||
check_mode: no | ||
|
||
- name: Linux/Unix | Finds the latest version of JetBrains Toolbox | ||
ansible.builtin.set_fact: | ||
jetbrains_toolbox_version: "{{ (jetbrains_index.content | from_json).TBA | map(attribute='build') | list | sort_versions | last }}" | ||
|
||
- name: Linux/Unix | Download JetBrains ToolBox | ||
ansible.builtin.unarchive: | ||
src: "{{ jetbrains_toolbox_pkg_url }}" | ||
dest: "{{ jetbrains_toolbox_tmp_folder }}" | ||
remote_src: yes | ||
|
||
- name: Linux/Unix | Install JetBrains ToolBox | ||
ansible.builtin.command: "{{ jetbrains_toolbox_install_exec}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
# vars file for Linux system | ||
jetbrains_toolbox_pkg_url: "https://download.jetbrains.com/toolbox/jetbrains-toolbox-{{ jetbrains_toolbox_version }}.tar.gz" | ||
jetbrains_toolbox_tmp_folder: "/tmp" | ||
jetbrains_toolbox_install_exec: "{{ jetbrains_toolbox_tmp_folder }}/jetbrains-toolbox-{{ jetbrains_toolbox_version }}/jetbrains-toolbox" |