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 WORKDIR /app
RUN yum update -y && yum install -y \ RUN yum update -y && yum install -y \
ansible ansible
COPY requirements.yml /app
RUN ansible-galaxy collection install -r requirements.yml
COPY . /app COPY . /app
RUN ansible-playbook /app/playbooks/image.yml 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: dependencies:
- role: info - role: info
- role: system - role: system
# - elliotweiser.osx-command-line-tools

View File

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

View File

@@ -1,6 +1,6 @@
--- ---
terminal_pkgs: terminal_pkgs:
#- atuin # - atuin
- bat - bat
- eza - eza
- direnv - direnv
@@ -10,7 +10,7 @@ terminal_pkgs:
- ripgrep - ripgrep
- neovim - neovim
- gh - gh
#- starship # - starship
- tmux - tmux
- zoxide - zoxide
- git - git

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