feat: full untested ansible setup
This commit is contained in:
32
roles/bun/tasks/main.yml
Normal file
32
roles/bun/tasks/main.yml
Normal file
@@ -0,0 +1,32 @@
|
||||
---
|
||||
- name: Resolve Bun architecture
|
||||
ansible.builtin.set_fact:
|
||||
bun_arch: "{{ bun_arch_map[ansible_facts.architecture] }}"
|
||||
|
||||
- name: Create Bun installation root
|
||||
ansible.builtin.file:
|
||||
path: "{{ bun_install_root }}"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0755"
|
||||
|
||||
- name: Download Bun release archive
|
||||
ansible.builtin.get_url:
|
||||
url: "https://github.com/oven-sh/bun/releases/download/bun-v{{ bun_version }}/bun-linux-{{ bun_arch }}.zip"
|
||||
dest: "/tmp/bun-linux-{{ bun_arch }}.zip"
|
||||
mode: "0644"
|
||||
|
||||
- name: Unpack Bun release
|
||||
ansible.builtin.unarchive:
|
||||
src: "/tmp/bun-linux-{{ bun_arch }}.zip"
|
||||
dest: "{{ bun_install_root }}"
|
||||
remote_src: true
|
||||
creates: "{{ bun_install_root }}/bun-linux-{{ bun_arch }}/bun"
|
||||
|
||||
- name: Symlink Bun binary into PATH
|
||||
ansible.builtin.file:
|
||||
src: "{{ bun_install_root }}/bun-linux-{{ bun_arch }}/bun"
|
||||
dest: "{{ bun_bin_path }}"
|
||||
state: link
|
||||
force: true
|
||||
Reference in New Issue
Block a user