summaryrefslogtreecommitdiff
path: root/tasks/sdkman.yml
blob: e87a4c04dc0f7495b9473dfc9ec3ee4174e67db1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
- name: Fetch sdkman installation script
  ansible.builtin.get_url:
    url: https://get.sdkman.io?rcupdate=false
    dest: /tmp/sdkman_install.sh
    mode: '0755'
  tags:
    - sdkman

- name: Run sdkman installation script
  ansible.builtin.command: /tmp/sdkman_install.sh
  changed_when: true
  tags:
    - sdkman

- name: Enable sdkman
  ansible.builtin.lineinfile:
    path: "~/.config/zsh/.zshrc"
    line: |
        #THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
        export SDKMAN_DIR="$HOME/.sdkman"
        [[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"
  tags:
    - sdkman

- name: Configure sdkman_auto_env
  ansible.builtin.lineinfile:
    path: "~/.sdkman/etc/config"
    regexp: '^sdkman_auto_env='
    line: sdkman_auto_env=true
  tags:
    - sdkman