mirror of
https://github.com/morten-olsen/configs.git
synced 2026-02-08 00:46:24 +01:00
cleanup
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
export TMPDIR="${TMPDIR:-/tmp}"
|
||||
export PATH="$PATH:$HOME/.local/bin"
|
||||
|
||||
alias ls=eza
|
||||
alias cat=bat
|
||||
alias grep=rg
|
||||
alias diff=delta
|
||||
alias less=bat
|
||||
alias gr='if [ "`git rev-parse --show-cdup`" != "" ]; then cd `git rev-parse --show-cdup`; fi'
|
||||
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
|
||||
39
playbooks/roles/base_terminal/tasks/config.yml
Normal file
39
playbooks/roles/base_terminal/tasks/config.yml
Normal file
@@ -0,0 +1,39 @@
|
||||
---
|
||||
- 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
|
||||
ansible.builtin.template:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ home }}/{{ item.path | regex_replace('\\.j2$', '') }}"
|
||||
mode: "{{ item.mode }}"
|
||||
with_community.general.filetree:
|
||||
- ../templates/{{ context }}
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
when: item.state == 'file'
|
||||
|
||||
- name: Copy config {{ context }}
|
||||
tags:
|
||||
- config
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ home }}/{{ item.path }}"
|
||||
mode: "{{ item.mode }}"
|
||||
with_community.general.filetree:
|
||||
- ../files/{{ context }}
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
when: item.state == 'file'
|
||||
33
playbooks/roles/base_terminal/tasks/install.yml
Normal file
33
playbooks/roles/base_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
|
||||
16
playbooks/roles/base_terminal/tasks/main.yml
Normal file
16
playbooks/roles/base_terminal/tasks/main.yml
Normal file
@@ -0,0 +1,16 @@
|
||||
---
|
||||
- name: Install context dependencies
|
||||
ansible.builtin.include_tasks: install.yml
|
||||
loop: "{{ contexts }}"
|
||||
loop_control:
|
||||
loop_var: context
|
||||
tags:
|
||||
- config
|
||||
|
||||
- name: Configure contexts
|
||||
ansible.builtin.include_tasks: config.yml
|
||||
loop: "{{ contexts }}"
|
||||
loop_control:
|
||||
loop_var: context
|
||||
tags:
|
||||
- config
|
||||
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
|
||||
4
playbooks/roles/base_terminal/vars/empty.yml
Normal file
4
playbooks/roles/base_terminal/vars/empty.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
terminal_pkgs: []
|
||||
terminal_casks: []
|
||||
terminal_flatpaks: []
|
||||
5
playbooks/roles/base_terminal/vars/zeronorth/default.yml
Normal file
5
playbooks/roles/base_terminal/vars/zeronorth/default.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
terminal_pkgs:
|
||||
- terraform
|
||||
- awscli
|
||||
- copier
|
||||
Reference in New Issue
Block a user