mirror of
https://github.com/morten-olsen/configs.git
synced 2026-02-08 00:46:24 +01:00
fix
This commit is contained in:
11
Dockerfile
11
Dockerfile
@@ -1,6 +1,9 @@
|
|||||||
FROM fedora
|
FROM fedora
|
||||||
WORKDIR /app
|
RUN dnf update -y && dnf install -y \
|
||||||
RUN yum update -y && yum install -y \
|
|
||||||
ansible
|
ansible
|
||||||
COPY . /app
|
RUN useradd -m -s /bin/bash -d /home/alice alice
|
||||||
RUN ansible-playbook /app/playbooks/image.yml
|
COPY . /opt/setup
|
||||||
|
RUN ansible-playbook /opt/setup/playbooks/image.yml
|
||||||
|
RUN mkdir /workspace && chown alice:alice /workspace
|
||||||
|
USER dev
|
||||||
|
WORKDIR /workspace
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
---
|
---
|
||||||
- name: Setup host
|
- name: Setup host
|
||||||
hosts: localhost
|
hosts: localhost
|
||||||
|
vars:
|
||||||
|
contexts: []
|
||||||
roles:
|
roles:
|
||||||
- role: env_terminal
|
- role: env_terminal
|
||||||
- role: env_develop
|
- role: env_develop
|
||||||
|
|||||||
@@ -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_contexts/meta/main.yml
Normal file
3
playbooks/roles/base_contexts/meta/main.yml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
dependencies:
|
||||||
|
- role: base_info
|
||||||
39
playbooks/roles/base_contexts/tasks/config.yml
Normal file
39
playbooks/roles/base_contexts/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'
|
||||||
34
playbooks/roles/base_contexts/tasks/install.yml
Normal file
34
playbooks/roles/base_contexts/tasks/install.yml
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
---
|
||||||
|
- 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
|
||||||
|
become: "{{ install_with_root }}"
|
||||||
|
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_contexts/tasks/main.yml
Normal file
16
playbooks/roles/base_contexts/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
|
||||||
@@ -1,12 +1,3 @@
|
|||||||
- 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
|
- name: Setting host facts
|
||||||
tags: always
|
tags: always
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
|
|||||||
3
playbooks/roles/base_terminal/defaults/main.yml
Normal file
3
playbooks/roles/base_terminal/defaults/main.yml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
install_with_root: true
|
||||||
|
terminal_casks: []
|
||||||
|
pkgs: []
|
||||||
@@ -1,10 +1,5 @@
|
|||||||
---
|
---
|
||||||
- name: "Unload vars : {{ context }}"
|
- name: "Load vars"
|
||||||
ansible.builtin.include_vars: ../vars/empty.yml
|
|
||||||
tags:
|
|
||||||
- install
|
|
||||||
|
|
||||||
- name: "Load vars : {{ context }}"
|
|
||||||
ansible.builtin.include_vars: "{{ item }}"
|
ansible.builtin.include_vars: "{{ item }}"
|
||||||
tags:
|
tags:
|
||||||
- install
|
- install
|
||||||
@@ -14,13 +9,14 @@
|
|||||||
- "{{ ansible_distribution }}.yml"
|
- "{{ ansible_distribution }}.yml"
|
||||||
- "{{ ansible_os_family }}.yml"
|
- "{{ ansible_os_family }}.yml"
|
||||||
- default.yml
|
- default.yml
|
||||||
paths: ../vars/{{ context }}
|
paths: ../vars
|
||||||
skip: true
|
skip: true
|
||||||
|
|
||||||
- name: "Install dependencies : {{ context }}"
|
- name: "Install dependencies"
|
||||||
tags:
|
tags:
|
||||||
- install
|
- install
|
||||||
when: terminal_pkgs
|
when: terminal_pkgs
|
||||||
|
become: "{{ install_with_root }}"
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
name: "{{ terminal_pkgs }}"
|
name: "{{ terminal_pkgs }}"
|
||||||
|
|
||||||
|
|||||||
14
playbooks/roles/base_terminal/vars/default.yml
Normal file
14
playbooks/roles/base_terminal/vars/default.yml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
terminal_pkgs:
|
||||||
|
- bat
|
||||||
|
- eza
|
||||||
|
- direnv
|
||||||
|
- fzf
|
||||||
|
- gnupg
|
||||||
|
- jq
|
||||||
|
- ripgrep
|
||||||
|
- neovim
|
||||||
|
- gh
|
||||||
|
- tmux
|
||||||
|
- zoxide
|
||||||
|
- sshpass
|
||||||
@@ -4,6 +4,7 @@ software_atuin_version: v18.3.0
|
|||||||
software_atuin_arch_map:
|
software_atuin_arch_map:
|
||||||
arm64: aarch64
|
arm64: aarch64
|
||||||
aarch64: aarch64
|
aarch64: aarch64
|
||||||
|
x86_64: x86_64
|
||||||
software_atuin_system_map:
|
software_atuin_system_map:
|
||||||
Darwin: apple-darwin
|
Darwin: apple-darwin
|
||||||
Linux: unknown-linux-gnu
|
Linux: unknown-linux-gnu
|
||||||
|
|||||||
1
playbooks/roles/software_git/defaults/main.yml
Normal file
1
playbooks/roles/software_git/defaults/main.yml
Normal file
@@ -0,0 +1 @@
|
|||||||
|
install_with_root: true
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
tags:
|
tags:
|
||||||
- install
|
- install
|
||||||
|
become: "{{ install_with_root }}"
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- git
|
- git
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ software_starship_version: v1.20.1
|
|||||||
software_starship_arch_map:
|
software_starship_arch_map:
|
||||||
arm64: aarch64
|
arm64: aarch64
|
||||||
aarch64: aarch64
|
aarch64: aarch64
|
||||||
|
x86_64: x86_64
|
||||||
software_starship_system_map:
|
software_starship_system_map:
|
||||||
Darwin: apple-darwin
|
Darwin: apple-darwin
|
||||||
Linux: unknown-linux-musl
|
Linux: unknown-linux-musl
|
||||||
|
|||||||
Reference in New Issue
Block a user