This commit is contained in:
2024-10-07 21:53:40 +02:00
parent c552125b12
commit 1ef33c16af
13 changed files with 134 additions and 23 deletions

View File

@@ -2,7 +2,5 @@ FROM fedora
WORKDIR /app
RUN yum update -y && yum install -y \
ansible
COPY requirements.yml /app
RUN ansible-galaxy collection install -r requirements.yml
COPY . /app
RUN ansible-playbook /app/playbooks/image.yml

View File

@@ -0,0 +1,14 @@
---
mirror: "https://github.com/atuinsh/atuin/releases/download/"
version: v18.3.0
arch_map:
arm64: aarch64
aarch64: aarch64
system_map:
Darwin: apple-darwin
Linux: unknown-linux-gnu
atuin_url: "{{ mirror }}/{{version}}/atuin-{{ arch_map[ansible_architecture] }}-{{ system_map[ansible_system] }}.tar.gz"
download_dir: "/tmp/atuin.tar.gz"
unpack_dir: "/tmp/atuin"
unpack_file: "{{ unpack_dir }}/atuin-{{ arch_map[ansible_architecture] }}-{{ system_map[ansible_system] }}/atuin"

View File

@@ -0,0 +1,4 @@
---
dependencies:
- role: info
- role: system

View File

@@ -0,0 +1,30 @@
- name: Download atuin
tags: always
ansible.builtin.get_url:
url: "{{ atuin_url }}"
dest: "{{ download_dir }}"
- name: Create dir
tags: always
ansible.builtin.file:
path: "{{ unpack_dir }}"
state: directory
- name: Extract foo.tgz into /var/lib/foo
tags: always
ansible.builtin.unarchive:
src: "{{ download_dir }}"
dest: "{{ unpack_dir }}"
- name: Ensure dir
tags: always
ansible.builtin.file:
path: "{{ home }}/.scripts"
state: directory
- name: Move bin
tags: always
ansible.builtin.copy:
remote_src: true
mode: 755
src: "{{ unpack_file }}"
dest: "{{ home }}/.scripts/atuin"

View File

@@ -0,0 +1,14 @@
---
mirror: "https://github.com/starship/starship/releases/download/"
version: v1.20.1
arch_map:
arm64: aarch64
aarch64: aarch64
system_map:
Darwin: apple-darwin
Linux: unknown-linux-musl
download_url: "{{ mirror }}/{{version}}/starship-{{ arch_map[ansible_architecture] }}-{{ system_map[ansible_system] }}.tar.gz"
download_dir: "/tmp/starship.tar.gz"
unpack_dir: "/tmp/starship"
unpack_file: "{{ unpack_dir }}/starship"

View File

@@ -0,0 +1,4 @@
---
dependencies:
- role: info
- role: system

View File

@@ -0,0 +1,30 @@
- name: Download starship
tags: always
ansible.builtin.get_url:
url: "{{ download_url }}"
dest: "{{ download_dir }}"
- name: Create dir
tags: always
ansible.builtin.file:
path: "{{ unpack_dir }}"
state: directory
- name: Extract starship
tags: always
ansible.builtin.unarchive:
src: "{{ download_dir }}"
dest: "{{ unpack_dir }}"
- name: Ensure dir
tags: always
ansible.builtin.file:
path: "{{ home }}/.scripts"
state: directory
- name: Move bin
tags: always
ansible.builtin.copy:
remote_src: true
mode: 755
src: "{{ unpack_file }}"
dest: "{{ home }}/.scripts/atuin"

View File

@@ -2,4 +2,3 @@
dependencies:
- role: info
- role: system
# - elliotweiser.osx-command-line-tools

View File

@@ -22,25 +22,23 @@
tags:
- config
- name: Clone nvm
- name: Install atuin
tags:
- install
ansible.builtin.git:
accept_newhostkey: true
clone: true
force: true
recursive: false
repo: https://github.com/nvm-sh/nvm
dest: "{{ home }}/.nvm"
include_role:
name: software/atuin
- name: Install node and set version
- name: Install starship
tags:
- install
include_role:
name: software/starship
- name: Setup node
tags:
- config
register: nodeinstall
ansible.builtin.shell: source {{ home }}/.nvm/nvm.sh && nvm install 22
changed_when: "'is already installed' not in nodeinstall.stderr"
args:
executable: /bin/bash
- install
include_tasks: "nvm.yml"
- name: Setup nvim
tags:

View File

@@ -0,0 +1,19 @@
- name: Clone nvm
tags:
- install
ansible.builtin.git:
accept_newhostkey: true
clone: true
force: true
recursive: false
repo: https://github.com/nvm-sh/nvm
dest: "{{ home }}/.nvm"
- name: Install node and set version
tags:
- config
register: nodeinstall
ansible.builtin.shell: source {{ home }}/.nvm/nvm.sh && nvm install 22
changed_when: "'is already installed' not in nodeinstall.stderr"
args:
executable: /bin/bash

5
playbooks/test.yml Normal file
View File

@@ -0,0 +1,5 @@
---
- name: Setup host
hosts: localhost
roles:
- software/atuin

View File

@@ -1,4 +0,0 @@
---
roles:
- name: elliotweiser.osx-command-line-tools
- name: andrewrothstein.starship