feat: add asdf package manager and elixir

This commit is contained in:
Ivan R. 2024-05-27 11:55:49 +05:00
parent 199f194147
commit 975d0afc31
Signed by: lumin
GPG key ID: E0937DC7CD6D3817
4 changed files with 32 additions and 0 deletions

View file

@ -1,6 +1,7 @@
- name: Development environment - name: Development environment
hosts: odhosts hosts: odhosts
roles: roles:
- asdf
- golang - golang
- python - python
- docker - docker

10
roles/asdf/files/elixir.sh Executable file
View file

@ -0,0 +1,10 @@
#!/bin/bash
ASDF_DIR=$HOME/src/asdf . ~/src/asdf/asdf.sh
asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git
asdf global erlang 27.0
asdf install erlang 27.0
asdf plugin add elixir https://github.com/asdf-vm/asdf-elixir.git
asdf global elixir 1.16
asdf install elixir 1.16

16
roles/asdf/tasks/main.yml Normal file
View file

@ -0,0 +1,16 @@
- name: Clone asdf
ansible.builtin.git:
repo: https://github.com/asdf-vm/asdf.git
dest: "{{ ansible_env.HOME }}/src/asdf"
version: v0.14.0
- name: Install plugin dependencies
become: true
ansible.builtin.apt:
pkg:
- build-essential
- autoconf
- m4
- unzip
- name: Install erlang and elixir
ansible.builtin.script:
cmd: files/elixir.sh

View file

@ -49,3 +49,8 @@ fi
# Firefox # Firefox
export MOZ_ENABLE_WAYLAND=1 export MOZ_ENABLE_WAYLAND=1
# Asdf - elixir, nodejs manager
if [ -d "$HOME/src/asdf" ] ; then
. "$HOME/src/asdf/asdf.sh"
fi