env/playbook.yml
Marc Cataford fe636d8deb
Some checks failed
/ sast (push) Failing after 26s
ci: yaml lint check
2024-07-27 10:03:29 -04:00

64 lines
2.3 KiB
YAML

---
- 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