env/playbook.yml

65 lines
2.3 KiB
YAML
Raw Normal View History

2024-05-20 19:20:58 +00:00
---
- name: Local environment
hosts: localhost
tasks:
- name: Ensure system up-to-date
2024-07-27 13:57:40 +00:00
become: true
2024-05-20 19:20:58 +00:00
apt:
2024-07-27 13:57:40 +00:00
update_cache: true
upgrade: "yes"
2024-05-20 19:20:58 +00:00
- name: Install terminal & shell
apt:
pkg:
- zsh
- tmux
2024-05-20 20:13:14 +00:00
- 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"
2024-05-20 19:20:58 +00:00
- 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