This commit is contained in:
parent
78ea75997a
commit
178c51628b
11 changed files with 72 additions and 75 deletions
12
README.md
12
README.md
|
@ -1,13 +1,5 @@
|
|||
# 🥫Environment-in-a-can
|
||||
|
||||
Environment tweaks for everyday happiness.
|
||||
Environment tweaks for (my) everyday happiness.
|
||||
|
||||
## Setup
|
||||
|
||||
Just run `./setup.sh`!
|
||||
|
||||
_Note_: This expects `pipx` to be installed on your system.
|
||||
|
||||
## Contributing
|
||||
|
||||
I'm not currently looking for contributions since this is mainly about standardizing my own setup across machines.
|
||||
Do the thing, it will do the needful: `./run.sh <playbook-path>`
|
||||
|
|
7
home.yml
Normal file
7
home.yml
Normal file
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
- name: Local environment
|
||||
hosts: localhost
|
||||
roles:
|
||||
- ubuntu
|
||||
- managed-blocks
|
||||
- tool-config
|
64
playbook.yml
64
playbook.yml
|
@ -1,64 +0,0 @@
|
|||
---
|
||||
- name: Local environment
|
||||
hosts: localhost
|
||||
|
||||
tasks:
|
||||
- name: Ensure system up-to-date
|
||||
become: true
|
||||
apt:
|
||||
update_cache: true
|
||||
upgrade: "yes"
|
||||
- name: Install terminal & shell
|
||||
apt:
|
||||
pkg:
|
||||
- zsh
|
||||
- tmux
|
||||
- name: Install OMZsh
|
||||
shell: |
|
||||
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
|
||||
args:
|
||||
creates: "{{ lookup('ansible.builtin.env', 'HOME') }}/.oh-my-zsh"
|
||||
- name: Install CLI tooling
|
||||
apt:
|
||||
pkg:
|
||||
- shellcheck
|
||||
- gh
|
||||
- name: Install gh CLI extensions (gh-dash)
|
||||
command: gh extension install dlvhdr/gh-dash
|
||||
- name: Install DB-related tooling
|
||||
apt:
|
||||
pkg:
|
||||
- postgresql
|
||||
- postgresql-contrib
|
||||
- name: Add zsh managed block
|
||||
blockinfile:
|
||||
path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.zshrc"
|
||||
marker: "# Marc's env managed block - {mark}"
|
||||
block: "{{ lookup('ansible.builtin.file', 'files/shell_extras') }}"
|
||||
- name: Add nvim managed block
|
||||
blockinfile:
|
||||
path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.config/nvim/init.vim"
|
||||
marker: "\" Marc's env managed block - {mark}"
|
||||
block: "{{ lookup('ansible.builtin.file', 'files/extras.vim') }}"
|
||||
- name: Add starship managed block
|
||||
blockinfile:
|
||||
path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.config/starship.toml"
|
||||
marker: "# Marc's env managed block - {mark}"
|
||||
block: "{{ lookup('ansible.builtin.file', 'files/starship.toml') }}"
|
||||
- name: Ensure gh-dash config directory exists
|
||||
file:
|
||||
path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.config/gh-dash"
|
||||
state: directory
|
||||
- name: Ensure gh-dash config exists
|
||||
file:
|
||||
path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.config/gh-dash/config.yml"
|
||||
state: touch
|
||||
- name: Add gh-dash configuration managed block
|
||||
blockinfile:
|
||||
path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.config/gh-dash/config.yml"
|
||||
marker: "# Marc's env managed block - {mark}"
|
||||
block: "{{ lookup('ansible.builtin.file', 'files/gh-dash.yml') }}"
|
||||
- name: Configure git
|
||||
shell: |
|
||||
git config --global commit.gpgsign true
|
||||
git config --global fetch.prune true
|
29
roles/managed-blocks/tasks/main.yml
Normal file
29
roles/managed-blocks/tasks/main.yml
Normal file
|
@ -0,0 +1,29 @@
|
|||
---
|
||||
- name: Add zsh managed block
|
||||
blockinfile:
|
||||
path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.zshrc"
|
||||
marker: "# Marc's env managed block - {mark}"
|
||||
block: "{{ lookup('ansible.builtin.file', 'files/shell_extras') }}"
|
||||
- name: Add nvim managed block
|
||||
blockinfile:
|
||||
path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.config/nvim/init.vim"
|
||||
marker: "\" Marc's env managed block - {mark}"
|
||||
block: "{{ lookup('ansible.builtin.file', 'files/extras.vim') }}"
|
||||
- name: Add starship managed block
|
||||
blockinfile:
|
||||
path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.config/starship.toml"
|
||||
marker: "# Marc's env managed block - {mark}"
|
||||
block: "{{ lookup('ansible.builtin.file', 'files/starship.toml') }}"
|
||||
- name: Ensure gh-dash config directory exists
|
||||
file:
|
||||
path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.config/gh-dash"
|
||||
state: directory
|
||||
- name: Ensure gh-dash config exists
|
||||
file:
|
||||
path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.config/gh-dash/config.yml"
|
||||
state: touch
|
||||
- name: Add gh-dash configuration managed block
|
||||
blockinfile:
|
||||
path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.config/gh-dash/config.yml"
|
||||
marker: "# Marc's env managed block - {mark}"
|
||||
block: "{{ lookup('ansible.builtin.file', 'files/gh-dash.yml') }}"
|
5
roles/tool-config/tasks/main.yml
Normal file
5
roles/tool-config/tasks/main.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
- name: Configure git
|
||||
shell: |
|
||||
git config --global commit.gpgsign true
|
||||
git config --global fetch.prune true
|
28
roles/ubuntu/tasks/main.yml
Normal file
28
roles/ubuntu/tasks/main.yml
Normal file
|
@ -0,0 +1,28 @@
|
|||
---
|
||||
- name: Ensure system up-to-date
|
||||
become: true
|
||||
apt:
|
||||
update_cache: true
|
||||
upgrade: "yes"
|
||||
- name: Install terminal & shell
|
||||
apt:
|
||||
pkg:
|
||||
- zsh
|
||||
- tmux
|
||||
- name: Install OMZsh
|
||||
shell: |
|
||||
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
|
||||
args:
|
||||
creates: "{{ lookup('ansible.builtin.env', 'HOME') }}/.oh-my-zsh"
|
||||
- name: Install CLI tooling
|
||||
apt:
|
||||
pkg:
|
||||
- shellcheck
|
||||
- gh
|
||||
- name: Install gh CLI extensions (gh-dash)
|
||||
command: gh extension install dlvhdr/gh-dash
|
||||
- name: Install DB-related tooling
|
||||
apt:
|
||||
pkg:
|
||||
- postgresql
|
||||
- postgresql-contrib
|
|
@ -6,4 +6,4 @@ if [[ -z "$(command -v pipx)" ]]; then
|
|||
fi
|
||||
|
||||
pipx install "ansible~=10.0"
|
||||
ansible-playbook -v --ask-become-pass ./playbook.yml
|
||||
ansible-playbook -v --ask-become-pass "$1"
|
Loading…
Reference in a new issue