Files
chezmoi/dot_bootstrap/setup.yml
2025-05-13 18:26:02 +02:00

133 lines
3.5 KiB
YAML

- name: Role out main Configuration to {{ ansible_hostname }}
hosts: localhost
connection: local
gather_facts: true
become: true
tasks:
- name: Get my user
ansible.builtin.set_fact:
regular_user: "{{ ansible_env.SUDO_USER or ansible_user_id }}"
- name: Install common packages
ansible.builtin.package:
name:
# Terminal tools
- mc
- git
- zsh
- htop
- fzf
- zoxide
- bat
- duf
- ripgrep
#- yazi
- tmux
# Editor
- neovim
# Backup/Restor
#- chezmoi
- rsync
# Network
- mosh
- nmap
- tcpdump
- fd-find
- xfce4-clipman
- speedcrunch
ignore_errors: true
- name: Install additionall packages...
ansible.builtin.package:
name:
- colordiff
ignore_errors: true
- name: Install NPM
ansible.builtin.package:
name:
- npm
ignore_errors: true
- name: Install Python dependencies
ansible.builtin.package:
name:
- python3-venv
ignore_errors: true
- name: Install additional packages...
ansible.builtin.package:
name:
- eza
ignore_errors: true
- name: Change shell to zsh
ansible.builtin.user:
name: "{{ regular_user }}"
shell: /usr/bin/zsh
- name: Create fonts directory
ansible.builtin.file:
path: "~{{ regular_user }}/.fonts"
state: directory
mode: "0755"
owner: "{{ regular_user }}"
- name: Install Oh My Posh
ansible.builtin.shell: curl -s https://ohmyposh.dev/install.sh | bash -s
args:
creates: ~/bin/oh-my-posh # Prevents rerunning if already installed
become: false # Set to true if you want to install system-wide (adjust path accordingly)
- name: Git checkout Tmux Plugin Manager
ansible.builtin.git:
repo: 'https://github.com/tmux-plugins/tpm'
dest: "~{{ regular_user }}/.config/tmux/plugins/tpm"
clone: yes
update: yes
force: yes
- name: TPM folder mode
ansible.builtin.file:
path: "~{{ regular_user }}/.config/tmux/plugins/"
mode: "0755"
owner: "{{ regular_user }}"
recurse: yes
become: yes
# - name: Installing Nerdfonts
# ansible.builtin.unarchive:
# #src: https://github.com/eliheuer/caskaydia-cove/archive/refs/heads/master.zip
# src: https://github.com/ryanoasis/nerd-fonts/releases/download/v3.3.0/CascadiaCode.zip
# dest: "~{{ regular_user }}/.fonts/"
# remote_src: true
# mode: "0755"
# owner: "{{ regular_user }}"
- name: Ensure fonts directory exists
ansible.builtin.file:
path: "~{{ regular_user }}/.fonts"
state: directory
owner: "{{ regular_user }}"
mode: "0755"
- name: Check if specific font files exist
ansible.builtin.find:
paths: "~{{ regular_user }}/.fonts"
patterns: "CaskaydiaCoveNerdFont*.ttf" # Adjust for actual font files in the zip
register: existing_fonts
- name: Download and extract Nerdfonts
ansible.builtin.unarchive:
src: https://github.com/ryanoasis/nerd-fonts/releases/download/v3.3.0/CascadiaCode.zip
dest: "~{{ regular_user }}/.fonts"
remote_src: true
owner: "{{ regular_user }}"
when: existing_fonts.matched == 0 # Only run if no matching fonts found