intellij_jdks

Ansible Role: IntelliJ JDKs

Tests Ansible Galaxy License

Role to configure JDKs in the IntelliJ IDEA IDE https://www.jetbrains.com/idea.

Requirements

  • Ansible >= 2.9

  • Linux Distribution

    • Debian Family

      • Ubuntu

        • Bionic (18.04)
        • Focal (20.04)
    • RedHat Family

      • Rocky Linux

        • 8
    • Note: other versions are likely to work but have not been tested.

Role Variables

The following variables will change the behavior of this role (default values are shown below):

# Directory containing IntelliJ IDEA user specific configuration (relative to user home)
# Note: the `ansible_local.intellij.general.user_config_dir` fact is provided by the gantsign.intellij role
intellij_jdks_intellij_user_config_dir: '{{ ansible_local.intellij.general.user_config_dir }}'

This role must be configured per user. Users are configured as follows:

users:
  - username: # Unix user name
    intellij_jdks:
      - name: # The name use want to use for this JDK
        home: # The path to the JDK home.
    # The name of the JDK you want to be the default for new projects.
    # Required if you specify `intellij_jdks`.
    # Must match the name given to one of the `intellij_jdks`.
    intellij_jdks_default:

Example Playbook

- hosts: servers
  roles:
    - role: gantsign.intellij_jdks
      users:
        - username: vagrant
          intellij_jdks:
            - name: '1.8'
              home: '/usr/lib/jvm/java-8-openjdk-amd64'
            - name: '1.7'
              home: '/usr/lib/jvm/java-7-openjdk-amd64'
            - name: '1.6'
              home: '/usr/lib/jvm/java-6-openjdk-amd64'
          intellij_jdks_default: '1.8'

You may find the following related roles useful:

More Roles From GantSign

You can find more roles from GantSign on Ansible Galaxy.

Development & Testing

This project uses Molecule to aid in the development and testing; the role is unit tested using Testinfra and pytest.

To develop or test you'll need to have installed the following:

Because the above can be tricky to install, this project includes Molecule Wrapper. Molecule Wrapper is a shell script that installs Molecule and it's dependencies (apart from Linux) and then executes Molecule with the command you pass it.

To test this role using Molecule Wrapper run the following command from the project root:

./moleculew test

Note: some of the dependencies need sudo permission to install.

License

MIT

Author Information

John Freeman

GantSign Ltd. Company No. 06109112 (registered in England)

About

Role for configuring JDKs in the IntelliJ IDEA IDE.

Install
ansible-galaxy install gantsign/ansible_role_intellij_jdks
GitHub repository
License
mit
Downloads
3107