mirror of
https://github.com/morten-olsen/configs.git
synced 2026-02-08 00:46:24 +01:00
cleanup
This commit is contained in:
@@ -2,4 +2,5 @@
|
||||
- name: Setup host
|
||||
hosts: localhost
|
||||
roles:
|
||||
- role: terminal
|
||||
- role: env_terminal
|
||||
- role: env_develop
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
- name: Show info
|
||||
debug:
|
||||
msg:
|
||||
user: "{{ ansible_user }}"
|
||||
home: "{{ ansible_env.HOME }}"
|
||||
distribution: "{{ ansible_distribution }}"
|
||||
family: "{{ ansible_os_family}}"
|
||||
arch: "{{ ansible_architecture }}"
|
||||
|
||||
- name: Setting host facts
|
||||
tags: always
|
||||
ansible.builtin.set_fact:
|
||||
2
playbooks/roles/base_system/meta/main.yml
Normal file
2
playbooks/roles/base_system/meta/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
dependencies:
|
||||
- role: base_info
|
||||
@@ -1,3 +1,6 @@
|
||||
export TMPDIR="${TMPDIR:-/tmp}"
|
||||
export PATH="$PATH:$HOME/.local/bin"
|
||||
|
||||
alias ls=eza
|
||||
alias cat=bat
|
||||
alias grep=rg
|
||||
3
playbooks/roles/base_terminal/meta/main.yml
Normal file
3
playbooks/roles/base_terminal/meta/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
dependencies:
|
||||
- role: base_info
|
||||
@@ -3,6 +3,7 @@
|
||||
tags:
|
||||
- config
|
||||
ansible.builtin.file:
|
||||
mode: "{{ item.mode }}"
|
||||
path: "{{ home }}/{{ item.path }}"
|
||||
state: directory
|
||||
with_community.general.filetree:
|
||||
14
playbooks/roles/base_terminal/vars/default/default.yml
Normal file
14
playbooks/roles/base_terminal/vars/default/default.yml
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
terminal_pkgs:
|
||||
- bat
|
||||
- eza
|
||||
- direnv
|
||||
- fzf
|
||||
- gnupg
|
||||
- jq
|
||||
- ripgrep
|
||||
- neovim
|
||||
- gh
|
||||
- tmux
|
||||
- zoxide
|
||||
- sshpass
|
||||
@@ -1,4 +0,0 @@
|
||||
---
|
||||
dependencies:
|
||||
- role: info
|
||||
- role: system
|
||||
@@ -1,4 +0,0 @@
|
||||
---
|
||||
dev_pkgs: []
|
||||
dev_casks: []
|
||||
dev_flatpaks: []
|
||||
@@ -1,4 +0,0 @@
|
||||
---
|
||||
dependencies:
|
||||
- role: info
|
||||
- role: system
|
||||
3
playbooks/roles/env_desktop/meta/main.yml
Normal file
3
playbooks/roles/env_desktop/meta/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
dependencies:
|
||||
- role: base_info
|
||||
3
playbooks/roles/env_develop/meta/main.yml
Normal file
3
playbooks/roles/env_develop/meta/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
dependencies:
|
||||
- role: base_info
|
||||
20
playbooks/roles/env_develop/tasks/main.yml
Normal file
20
playbooks/roles/env_develop/tasks/main.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
- name: "Load vars : {{ context }}"
|
||||
ansible.builtin.include_vars: "{{ item }}"
|
||||
tags:
|
||||
- install
|
||||
with_first_found:
|
||||
- files:
|
||||
- "{{ ansible_distribution }}-{{ ansible_distribution_release }}.yml"
|
||||
- "{{ ansible_distribution }}.yml"
|
||||
- "{{ ansible_os_family }}.yml"
|
||||
- default.yml
|
||||
paths: ../vars
|
||||
skip: true
|
||||
|
||||
- name: "Install dependencies"
|
||||
tags:
|
||||
- install
|
||||
when: env_develop_pkgs
|
||||
ansible.builtin.package:
|
||||
name: "{{ env_develop_pkgs }}"
|
||||
@@ -1,4 +1,4 @@
|
||||
---
|
||||
dev_pkgs:
|
||||
env_develop_pkgs:
|
||||
- rustup
|
||||
- python3
|
||||
11
playbooks/roles/env_terminal/meta/main.yml
Normal file
11
playbooks/roles/env_terminal/meta/main.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
---
|
||||
dependencies:
|
||||
- role: base_info
|
||||
- role: software_git
|
||||
- role: software_zsh
|
||||
- role: software_starship
|
||||
- role: software_tmux
|
||||
- role: software_ssh
|
||||
- role: software_nvm
|
||||
- role: software_nvim
|
||||
- role: software_atuin
|
||||
@@ -1,4 +1,17 @@
|
||||
---
|
||||
- name: Copy config {{ context }}
|
||||
tags:
|
||||
- config
|
||||
ansible.builtin.file:
|
||||
mode: "{{ item.mode }}"
|
||||
path: "{{ home }}/{{ item.path }}"
|
||||
state: directory
|
||||
with_community.general.filetree:
|
||||
- ../files/{{ context }}
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
when: item.state == 'directory'
|
||||
|
||||
- name: "Copy templates : {{ context }}"
|
||||
tags:
|
||||
- config
|
||||
@@ -12,7 +25,7 @@
|
||||
label: "{{ item.path }}"
|
||||
when: item.state == 'file'
|
||||
|
||||
- name: "Copy config : {{ context }}"
|
||||
- name: Copy config {{ context }}
|
||||
tags:
|
||||
- config
|
||||
ansible.builtin.copy:
|
||||
33
playbooks/roles/env_terminal/tasks/install.yml
Normal file
33
playbooks/roles/env_terminal/tasks/install.yml
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
- name: "Unload vars : {{ context }}"
|
||||
ansible.builtin.include_vars: ../vars/empty.yml
|
||||
tags:
|
||||
- install
|
||||
|
||||
- name: "Load vars : {{ context }}"
|
||||
ansible.builtin.include_vars: "{{ item }}"
|
||||
tags:
|
||||
- install
|
||||
with_first_found:
|
||||
- files:
|
||||
- "{{ ansible_distribution }}-{{ ansible_distribution_release }}.yml"
|
||||
- "{{ ansible_distribution }}.yml"
|
||||
- "{{ ansible_os_family }}.yml"
|
||||
- default.yml
|
||||
paths: ../vars/{{ context }}
|
||||
skip: true
|
||||
|
||||
- name: "Install dependencies : {{ context }}"
|
||||
tags:
|
||||
- install
|
||||
when: terminal_pkgs
|
||||
ansible.builtin.package:
|
||||
name: "{{ terminal_pkgs }}"
|
||||
|
||||
- name: "Install casks : {{ context }}"
|
||||
tags:
|
||||
- install
|
||||
when: terminal_casks
|
||||
community.general.homebrew_cask:
|
||||
name: "{{ terminal_casks }}"
|
||||
state: installed
|
||||
22
playbooks/roles/env_terminal/tasks/main.yml
Normal file
22
playbooks/roles/env_terminal/tasks/main.yml
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
- name: Install context dependencies
|
||||
ansible.builtin.include_tasks: install.yml
|
||||
loop: "{{ contexts }}"
|
||||
loop_control:
|
||||
loop_var: context
|
||||
tags:
|
||||
- config
|
||||
|
||||
- name: Install atuin
|
||||
tags:
|
||||
- install
|
||||
ansible.builtin.include_role:
|
||||
name: software_atuin
|
||||
|
||||
- name: Configure contexts
|
||||
ansible.builtin.include_tasks: config.yml
|
||||
loop: "{{ contexts }}"
|
||||
loop_control:
|
||||
loop_var: context
|
||||
tags:
|
||||
- config
|
||||
4
playbooks/roles/env_terminal/vars/empty.yml
Normal file
4
playbooks/roles/env_terminal/vars/empty.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
terminal_pkgs: []
|
||||
terminal_casks: []
|
||||
terminal_flatpaks: []
|
||||
5
playbooks/roles/env_terminal/vars/zeronorth/default.yml
Normal file
5
playbooks/roles/env_terminal/vars/zeronorth/default.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
terminal_pkgs:
|
||||
- terraform
|
||||
- awscli
|
||||
- copier
|
||||
3
playbooks/roles/server_ssh/meta/main.yml
Normal file
3
playbooks/roles/server_ssh/meta/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
dependencies:
|
||||
- role: base_info
|
||||
39
playbooks/roles/server_ssh/tasks/main.yml
Normal file
39
playbooks/roles/server_ssh/tasks/main.yml
Normal file
@@ -0,0 +1,39 @@
|
||||
---
|
||||
- name: Copy config
|
||||
tags:
|
||||
- config
|
||||
ansible.builtin.file:
|
||||
mode: "{{ item.mode }}"
|
||||
path: "{{ home }}/{{ item.path }}"
|
||||
state: directory
|
||||
with_community.general.filetree:
|
||||
- ../files
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
when: item.state == 'directory'
|
||||
|
||||
- name: "Copy templates"
|
||||
tags:
|
||||
- config
|
||||
ansible.builtin.template:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ home }}/{{ item.path | regex_replace('\\.j2$', '') }}"
|
||||
mode: "{{ item.mode }}"
|
||||
with_community.general.filetree:
|
||||
- ../templates
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
when: item.state == 'file'
|
||||
|
||||
- name: Copy config
|
||||
tags:
|
||||
- config
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ home }}/{{ item.path }}"
|
||||
mode: "{{ item.mode }}"
|
||||
with_community.general.filetree:
|
||||
- ../files
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
when: item.state == 'file'
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
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"
|
||||
@@ -1,4 +0,0 @@
|
||||
---
|
||||
dependencies:
|
||||
- role: info
|
||||
- role: system
|
||||
@@ -1,30 +0,0 @@
|
||||
- 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"
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
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"
|
||||
@@ -1,4 +0,0 @@
|
||||
---
|
||||
dependencies:
|
||||
- role: info
|
||||
- role: system
|
||||
14
playbooks/roles/software_atuin/defaults/main.yml
Normal file
14
playbooks/roles/software_atuin/defaults/main.yml
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
software_atuin_mirror: https://github.com/atuinsh/atuin/releases/download/
|
||||
software_atuin_version: v18.3.0
|
||||
software_atuin_arch_map:
|
||||
arm64: aarch64
|
||||
aarch64: aarch64
|
||||
software_atuin_system_map:
|
||||
Darwin: apple-darwin
|
||||
Linux: unknown-linux-gnu
|
||||
|
||||
software_atuin_download_url: "{{ software_atuin_mirror }}/{{ software_atuin_version }}/atuin-{{ software_atuin_arch_map[ansible_architecture] }}-{{ software_atuin_system_map[ansible_system] }}.tar.gz"
|
||||
software_atuin_download_dir: /tmp/atuin.tar.gz
|
||||
software_atuin_unpack_dir: /tmp/atuin
|
||||
software_atuin_unpack_file: "{{ software_atuin_unpack_dir }}/atuin-{{ software_atuin_arch_map[ansible_architecture] }}-{{ software_atuin_system_map[ansible_system] }}/atuin"
|
||||
4
playbooks/roles/software_atuin/meta/main.yml
Normal file
4
playbooks/roles/software_atuin/meta/main.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
dependencies:
|
||||
- role: base_info
|
||||
- role: base_terminal
|
||||
60
playbooks/roles/software_atuin/tasks/main.yml
Normal file
60
playbooks/roles/software_atuin/tasks/main.yml
Normal file
@@ -0,0 +1,60 @@
|
||||
---
|
||||
- name: Download atuin
|
||||
tags: always
|
||||
ansible.builtin.get_url:
|
||||
url: "{{ software_atuin_download_url }}"
|
||||
dest: "{{ software_atuin_download_dir }}"
|
||||
mode: "0600"
|
||||
|
||||
- name: Create dir
|
||||
tags: always
|
||||
ansible.builtin.file:
|
||||
path: "{{ software_atuin_unpack_dir }}"
|
||||
mode: "0755"
|
||||
state: directory
|
||||
|
||||
- name: Unpacking atuin
|
||||
tags: always
|
||||
ansible.builtin.unarchive:
|
||||
src: "{{ software_atuin_download_dir }}"
|
||||
dest: "{{ software_atuin_unpack_dir }}"
|
||||
|
||||
- name: Ensure dir
|
||||
tags: always
|
||||
ansible.builtin.file:
|
||||
path: "{{ home }}/.scripts"
|
||||
mode: "0755"
|
||||
state: directory
|
||||
- name: Move bin
|
||||
tags: always
|
||||
ansible.builtin.copy:
|
||||
remote_src: true
|
||||
mode: "0755"
|
||||
src: "{{ software_atuin_unpack_file }}"
|
||||
dest: "{{ home }}/.local/bin/atuin"
|
||||
|
||||
- name: Setup config dirctories
|
||||
tags:
|
||||
- config
|
||||
ansible.builtin.file:
|
||||
mode: "{{ item.mode }}"
|
||||
path: "{{ home }}/{{ item.path }}"
|
||||
state: directory
|
||||
with_community.general.filetree:
|
||||
- ../files
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
when: item.state == 'directory'
|
||||
|
||||
- name: Copy config {{ context }}
|
||||
tags:
|
||||
- config
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ home }}/{{ item.path }}"
|
||||
mode: "{{ item.mode }}"
|
||||
with_community.general.filetree:
|
||||
- ../files
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
when: item.state == 'file'
|
||||
3
playbooks/roles/software_docker/meta/main.yml
Normal file
3
playbooks/roles/software_docker/meta/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
dependencies:
|
||||
- role: base_info
|
||||
3
playbooks/roles/software_git/meta/main.yml
Normal file
3
playbooks/roles/software_git/meta/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
dependencies:
|
||||
- role: base_info
|
||||
47
playbooks/roles/software_git/tasks/main.yml
Normal file
47
playbooks/roles/software_git/tasks/main.yml
Normal file
@@ -0,0 +1,47 @@
|
||||
---
|
||||
- name: Install dependencies
|
||||
tags:
|
||||
- install
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
- git
|
||||
- git-delta
|
||||
|
||||
- name: Copy config
|
||||
tags:
|
||||
- config
|
||||
ansible.builtin.file:
|
||||
mode: "{{ item.mode }}"
|
||||
path: "{{ home }}/{{ item.path }}"
|
||||
state: directory
|
||||
with_community.general.filetree:
|
||||
- ../files
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
when: item.state == 'directory'
|
||||
|
||||
- name: "Copy templates"
|
||||
tags:
|
||||
- config
|
||||
ansible.builtin.template:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ home }}/{{ item.path | regex_replace('\\.j2$', '') }}"
|
||||
mode: "{{ item.mode }}"
|
||||
with_community.general.filetree:
|
||||
- ../templates
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
when: item.state == 'file'
|
||||
|
||||
- name: Copy config
|
||||
tags:
|
||||
- config
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ home }}/{{ item.path }}"
|
||||
mode: "{{ item.mode }}"
|
||||
with_community.general.filetree:
|
||||
- ../files
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
when: item.state == 'file'
|
||||
4
playbooks/roles/software_nvim/meta/main.yml
Normal file
4
playbooks/roles/software_nvim/meta/main.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
dependencies:
|
||||
- role: base_info
|
||||
- role: base_terminal
|
||||
@@ -16,7 +16,7 @@
|
||||
- config
|
||||
- nvim
|
||||
register: nviminstall
|
||||
changed_when: "nviminstall.stdout != ''"
|
||||
changed_when: nviminstall.stdout != ''
|
||||
ansible.builtin.shell: nvim --headless +q
|
||||
args:
|
||||
executable: /bin/bash
|
||||
56
playbooks/roles/software_nvim/tasks/main.yml
Normal file
56
playbooks/roles/software_nvim/tasks/main.yml
Normal file
@@ -0,0 +1,56 @@
|
||||
---
|
||||
- name: Install dependencies
|
||||
tags:
|
||||
- install
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
- neovim
|
||||
- git
|
||||
|
||||
- name: Setup config dirctories
|
||||
tags:
|
||||
- config
|
||||
ansible.builtin.file:
|
||||
mode: "{{ item.mode }}"
|
||||
path: "{{ home }}/{{ item.path }}"
|
||||
state: directory
|
||||
with_community.general.filetree:
|
||||
- ../files
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
when: item.state == 'directory'
|
||||
|
||||
- name: Copy config {{ context }}
|
||||
tags:
|
||||
- config
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ home }}/{{ item.path }}"
|
||||
mode: "{{ item.mode }}"
|
||||
with_community.general.filetree:
|
||||
- ../files
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
when: item.state == 'file'
|
||||
|
||||
- name: Configure neovim
|
||||
tags:
|
||||
- config
|
||||
- nvim
|
||||
ansible.builtin.git:
|
||||
repo: https://github.com/morten-olsen/nvim
|
||||
dest: "{{ home }}/.config/nvim"
|
||||
accept_newhostkey: true
|
||||
clone: true
|
||||
update: true
|
||||
force: true
|
||||
|
||||
- name: Prepare neovim
|
||||
tags:
|
||||
- config
|
||||
- nvim
|
||||
register: nviminstall
|
||||
changed_when: nviminstall.stdout != ''
|
||||
ansible.builtin.shell: nvim --headless +q
|
||||
args:
|
||||
executable: /bin/bash
|
||||
4
playbooks/roles/software_nvm/meta/main.yml
Normal file
4
playbooks/roles/software_nvm/meta/main.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
dependencies:
|
||||
- role: base_info
|
||||
- role: base_terminal
|
||||
51
playbooks/roles/software_nvm/tasks/main.yml
Normal file
51
playbooks/roles/software_nvm/tasks/main.yml
Normal file
@@ -0,0 +1,51 @@
|
||||
---
|
||||
- name: Install dependencies
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
- git
|
||||
|
||||
- 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
|
||||
|
||||
- name: Setup config dirctories
|
||||
tags:
|
||||
- config
|
||||
ansible.builtin.file:
|
||||
mode: "{{ item.mode }}"
|
||||
path: "{{ home }}/{{ item.path }}"
|
||||
state: directory
|
||||
with_community.general.filetree:
|
||||
- ../files
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
when: item.state == 'directory'
|
||||
|
||||
- name: Copy config {{ context }}
|
||||
tags:
|
||||
- config
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ home }}/{{ item.path }}"
|
||||
mode: "{{ item.mode }}"
|
||||
with_community.general.filetree:
|
||||
- ../files
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
when: item.state == 'file'
|
||||
4
playbooks/roles/software_ssh/meta/main.yml
Normal file
4
playbooks/roles/software_ssh/meta/main.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
dependencies:
|
||||
- role: base_info
|
||||
- role: base_terminal
|
||||
0
playbooks/roles/software_ssh/tasks/main.yml
Normal file
0
playbooks/roles/software_ssh/tasks/main.yml
Normal file
14
playbooks/roles/software_starship/defaults/main.yml
Normal file
14
playbooks/roles/software_starship/defaults/main.yml
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
software_starship_mirror: "https://github.com/starship/starship/releases/download/"
|
||||
software_starship_version: v1.20.1
|
||||
software_starship_arch_map:
|
||||
arm64: aarch64
|
||||
aarch64: aarch64
|
||||
software_starship_system_map:
|
||||
Darwin: apple-darwin
|
||||
Linux: unknown-linux-musl
|
||||
|
||||
software_starship_download_url: "{{ software_starship_mirror }}/{{ software_starship_version }}/starship-{{ software_starship_arch_map[ansible_architecture] }}-{{ software_starship_system_map[ansible_system] }}.tar.gz"
|
||||
software_starship_download_dir: "/tmp/starship.tar.gz"
|
||||
software_starship_unpack_dir: "/tmp/starship"
|
||||
software_starship_unpack_file: "{{ software_starship_unpack_dir }}/starship"
|
||||
4
playbooks/roles/software_starship/meta/main.yml
Normal file
4
playbooks/roles/software_starship/meta/main.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
dependencies:
|
||||
- role: base_info
|
||||
- role: base_terminal
|
||||
@@ -1,30 +1,34 @@
|
||||
- name: Download starship
|
||||
tags: always
|
||||
ansible.builtin.get_url:
|
||||
url: "{{ download_url }}"
|
||||
dest: "{{ download_dir }}"
|
||||
mode: "0600"
|
||||
url: "{{ software_starship_download_url }}"
|
||||
dest: "{{ software_starship_download_dir }}"
|
||||
|
||||
- name: Create dir
|
||||
tags: always
|
||||
ansible.builtin.file:
|
||||
path: "{{ unpack_dir }}"
|
||||
mode: "0755"
|
||||
path: "{{ software_starship_unpack_dir }}"
|
||||
state: directory
|
||||
|
||||
- name: Extract starship
|
||||
tags: always
|
||||
ansible.builtin.unarchive:
|
||||
src: "{{ download_dir }}"
|
||||
dest: "{{ unpack_dir }}"
|
||||
src: "{{ software_starship_download_dir }}"
|
||||
dest: "{{ software_starship_unpack_dir }}"
|
||||
|
||||
- name: Ensure dir
|
||||
tags: always
|
||||
ansible.builtin.file:
|
||||
mode: "0755"
|
||||
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"
|
||||
mode: "0755"
|
||||
src: "{{ software_starship_unpack_file }}"
|
||||
dest: "{{ home }}/.local/bin/starship"
|
||||
4
playbooks/roles/software_tmux/meta/main.yml
Normal file
4
playbooks/roles/software_tmux/meta/main.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
dependencies:
|
||||
- role: base_info
|
||||
- role: base_terminal
|
||||
39
playbooks/roles/software_tmux/tasks/main.yml
Normal file
39
playbooks/roles/software_tmux/tasks/main.yml
Normal file
@@ -0,0 +1,39 @@
|
||||
---
|
||||
- name: Copy config
|
||||
tags:
|
||||
- config
|
||||
ansible.builtin.file:
|
||||
mode: "{{ item.mode }}"
|
||||
path: "{{ home }}/{{ item.path }}"
|
||||
state: directory
|
||||
with_community.general.filetree:
|
||||
- ../files
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
when: item.state == 'directory'
|
||||
|
||||
- name: "Copy templates"
|
||||
tags:
|
||||
- config
|
||||
ansible.builtin.template:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ home }}/{{ item.path | regex_replace('\\.j2$', '') }}"
|
||||
mode: "{{ item.mode }}"
|
||||
with_community.general.filetree:
|
||||
- ../templates
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
when: item.state == 'file'
|
||||
|
||||
- name: Copy config
|
||||
tags:
|
||||
- config
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ home }}/{{ item.path }}"
|
||||
mode: "{{ item.mode }}"
|
||||
with_community.general.filetree:
|
||||
- ../files
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
when: item.state == 'file'
|
||||
4
playbooks/roles/software_zsh/meta/main.yml
Normal file
4
playbooks/roles/software_zsh/meta/main.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
dependencies:
|
||||
- role: base_info
|
||||
- role: base_terminal
|
||||
54
playbooks/roles/software_zsh/tasks/main.yml
Normal file
54
playbooks/roles/software_zsh/tasks/main.yml
Normal file
@@ -0,0 +1,54 @@
|
||||
---
|
||||
- name: Install core dependencies
|
||||
tags:
|
||||
- install
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
- zsh
|
||||
|
||||
- name: Set shell
|
||||
become: true
|
||||
tags:
|
||||
- config
|
||||
ansible.builtin.user:
|
||||
name: "{{ username }}"
|
||||
shell: /usr/bin/zsh
|
||||
|
||||
- name: Copy config
|
||||
tags:
|
||||
- config
|
||||
ansible.builtin.file:
|
||||
mode: "{{ item.mode }}"
|
||||
path: "{{ home }}/{{ item.path }}"
|
||||
state: directory
|
||||
with_community.general.filetree:
|
||||
- ../files
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
when: item.state == 'directory'
|
||||
|
||||
- name: "Copy templates"
|
||||
tags:
|
||||
- config
|
||||
ansible.builtin.template:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ home }}/{{ item.path | regex_replace('\\.j2$', '') }}"
|
||||
mode: "{{ item.mode }}"
|
||||
with_community.general.filetree:
|
||||
- ../templates
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
when: item.state == 'file'
|
||||
|
||||
- name: Copy config
|
||||
tags:
|
||||
- config
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ home }}/{{ item.path }}"
|
||||
mode: "{{ item.mode }}"
|
||||
with_community.general.filetree:
|
||||
- ../files
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
when: item.state == 'file'
|
||||
@@ -1,2 +0,0 @@
|
||||
dependencies:
|
||||
- role: info
|
||||
@@ -1 +0,0 @@
|
||||
export TMPDIR="${TMPDIR:-/tmp}"
|
||||
@@ -1,2 +0,0 @@
|
||||
export PATH="$PATH:$HOME/.scripts"
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
export GPG_TTY="$(tty)"
|
||||
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
|
||||
gpgconf --launch gpg-agent
|
||||
gpg-connect-agent updatestartuptty /bye > /dev/null
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
---
|
||||
dependencies:
|
||||
- role: info
|
||||
- role: system
|
||||
@@ -1,55 +0,0 @@
|
||||
---
|
||||
- name: Install core dependencies
|
||||
tags:
|
||||
- install
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
- zsh
|
||||
|
||||
- name: Set shell
|
||||
become: true
|
||||
tags:
|
||||
- config
|
||||
ansible.builtin.user:
|
||||
name: "{{ username }}"
|
||||
shell: /usr/bin/zsh
|
||||
|
||||
- name: Install context dependencies
|
||||
ansible.builtin.include_tasks: install.yml
|
||||
loop: "{{ contexts }}"
|
||||
loop_control:
|
||||
loop_var: context
|
||||
tags:
|
||||
- config
|
||||
|
||||
- name: Install atuin
|
||||
tags:
|
||||
- install
|
||||
include_role:
|
||||
name: software/atuin
|
||||
|
||||
- name: Install starship
|
||||
tags:
|
||||
- install
|
||||
include_role:
|
||||
name: software/starship
|
||||
|
||||
- name: Setup node
|
||||
tags:
|
||||
- config
|
||||
- install
|
||||
include_tasks: "nvm.yml"
|
||||
|
||||
- name: Setup nvim
|
||||
tags:
|
||||
- config
|
||||
- nvim
|
||||
include_tasks: "nvim.yml"
|
||||
|
||||
- name: Configure contexts
|
||||
ansible.builtin.include_tasks: config.yml
|
||||
loop: "{{ contexts }}"
|
||||
loop_control:
|
||||
loop_var: context
|
||||
tags:
|
||||
- config
|
||||
@@ -1,19 +0,0 @@
|
||||
- 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
|
||||
@@ -1,7 +1,15 @@
|
||||
---
|
||||
- name: Setup host
|
||||
- name: Setup desktop
|
||||
hosts: desktops
|
||||
roles:
|
||||
- role: terminal
|
||||
- role: desktop
|
||||
- role: docker
|
||||
- role: env_terminal
|
||||
- role: env_develop
|
||||
- role: server_ssh
|
||||
- role: env_desktop
|
||||
|
||||
- name: Setup android
|
||||
hosts: android
|
||||
roles:
|
||||
- role: env_terminal
|
||||
- role: env_develop
|
||||
- role: server_ssh
|
||||
|
||||
Reference in New Issue
Block a user