mirror of
https://github.com/fscotto/infra.git
synced 2026-09-27 19:03:47 +00:00
193 lines
6.3 KiB
YAML
193 lines
6.3 KiB
YAML
---
|
|
- name: Ensure bat package is installed
|
|
tags: [packages]
|
|
ansible.builtin.package:
|
|
name: bat
|
|
state: present
|
|
|
|
- name: Ensure XDG user directories exist
|
|
tags: [dotfiles, dotfiles:common]
|
|
ansible.builtin.file:
|
|
path: "{{ effective_user_home }}/{{ item }}"
|
|
state: directory
|
|
owner: "{{ effective_username }}"
|
|
group: "{{ effective_user_group }}"
|
|
mode: "0755"
|
|
loop: "{{ xdg_user_directories | default([]) }}"
|
|
when: "'desktop' in group_names"
|
|
|
|
- name: Extract templates kit to Templates directory
|
|
tags: [dotfiles, dotfiles:common]
|
|
ansible.builtin.unarchive:
|
|
src: "{{ playbook_dir }}/../dotfiles/common/templates_kit.zip"
|
|
dest: "{{ effective_user_home }}/Templates"
|
|
owner: "{{ effective_username }}"
|
|
group: "{{ effective_user_group }}"
|
|
creates: "{{ effective_user_home }}/Templates/code/main.c"
|
|
when: "'desktop' in group_names"
|
|
|
|
- name: Ensure Emacs authoring directories exist
|
|
tags: [dotfiles, dotfiles:common, emacs]
|
|
ansible.builtin.file:
|
|
path: "{{ effective_user_home }}/{{ item }}"
|
|
state: directory
|
|
owner: "{{ effective_username }}"
|
|
group: "{{ effective_user_group }}"
|
|
mode: "0755"
|
|
loop: "{{ emacs_authoring_directories | default([]) }}"
|
|
when:
|
|
- emacs_enabled | default(false) | bool
|
|
- not (workstation_is_wsl | default(false) | bool)
|
|
|
|
- name: Deploy the shared Emacs authoring configuration
|
|
tags: [dotfiles, dotfiles:common, emacs]
|
|
ansible.builtin.copy:
|
|
src: "{{ playbook_dir }}/../dotfiles/desktop/{{ item.src }}"
|
|
dest: "{{ effective_user_home }}/{{ item.dest }}"
|
|
owner: "{{ effective_username }}"
|
|
group: "{{ effective_user_group }}"
|
|
mode: "{{ item.mode }}"
|
|
loop: "{{ emacs_dotfiles | default([]) }}"
|
|
loop_control:
|
|
label: "{{ item.dest }}"
|
|
when:
|
|
- emacs_enabled | default(false) | bool
|
|
- not (workstation_is_wsl | default(false) | bool)
|
|
|
|
- name: Deploy Emacs authoring assets
|
|
tags: [dotfiles, dotfiles:common, emacs]
|
|
ansible.builtin.copy:
|
|
src: "{{ playbook_dir }}/../dotfiles/desktop/{{ item.src }}"
|
|
dest: "{{ effective_user_home }}/{{ item.dest }}"
|
|
owner: "{{ effective_username }}"
|
|
group: "{{ effective_user_group }}"
|
|
mode: "{{ item.mode }}"
|
|
loop: "{{ emacs_authoring_files | default([]) }}"
|
|
loop_control:
|
|
label: "{{ item.dest }}"
|
|
when:
|
|
- emacs_enabled | default(false) | bool
|
|
- not (workstation_is_wsl | default(false) | bool)
|
|
|
|
- name: Ensure SSH socket directory exists
|
|
tags: [dotfiles, dotfiles:common]
|
|
ansible.builtin.file:
|
|
path: "{{ effective_user_home }}/.local/state/ssh/sockets"
|
|
state: directory
|
|
owner: "{{ effective_username }}"
|
|
group: "{{ effective_user_group }}"
|
|
mode: "0700"
|
|
|
|
- name: Copy common dotfiles
|
|
tags: [dotfiles, dotfiles:common]
|
|
ansible.builtin.copy:
|
|
src: "{{ playbook_dir }}/../dotfiles/common/{{ item.src }}"
|
|
dest: "{{ effective_user_home }}/{{ item.dest }}"
|
|
owner: "{{ effective_username }}"
|
|
group: "{{ effective_user_group }}"
|
|
mode: "{{ item.mode }}"
|
|
loop: >-
|
|
{{ common_dotfiles | default([]) }}
|
|
loop_control:
|
|
label: "{{ item.dest }}"
|
|
|
|
- name: Deploy AI coding-agent dotfiles
|
|
tags: [dotfiles, dotfiles:common, ai_agents]
|
|
ansible.builtin.copy:
|
|
src: "{{ playbook_dir }}/../dotfiles/common/{{ item.src }}"
|
|
dest: "{{ effective_user_home }}/{{ item.dest }}"
|
|
owner: "{{ effective_username }}"
|
|
group: "{{ effective_user_group }}"
|
|
mode: "{{ item.mode }}"
|
|
loop: "{{ ai_agents_dotfiles | default([]) }}"
|
|
loop_control:
|
|
label: "{{ item.dest }}"
|
|
when:
|
|
- (item.agents | intersect(ai_agents_deploy_enabled_names)) | length > 0
|
|
- (ai_agents_dotfiles | default([])) | length > 0
|
|
|
|
- name: Install distro packages for Vim plugins
|
|
tags: [packages, vim, fzf]
|
|
ansible.builtin.package:
|
|
name: "{{ vim_plugin_distro_packages | default([]) }}"
|
|
state: present
|
|
when:
|
|
- vim_plugins_enabled | default(false)
|
|
- (vim_plugin_distro_packages | default([])) | length > 0
|
|
|
|
- name: Ensure git package is installed for source Vim plugins
|
|
tags: [packages, vim, fzf]
|
|
ansible.builtin.package:
|
|
name: git
|
|
state: present
|
|
when:
|
|
- vim_plugins_enabled | default(false)
|
|
- (vim_plugin_source_plugins | default([])) | length > 0
|
|
|
|
- name: Ensure Vim plugin pack directory exists
|
|
tags: [dotfiles, dotfiles:common, vim, fzf]
|
|
ansible.builtin.file:
|
|
path: "{{ effective_user_home }}/.vim/pack/plugins/opt"
|
|
state: directory
|
|
owner: "{{ effective_username }}"
|
|
group: "{{ effective_user_group }}"
|
|
mode: "0755"
|
|
when:
|
|
- vim_plugins_enabled | default(false)
|
|
- (vim_plugin_source_plugins | default([])) | length > 0
|
|
|
|
- name: Install source Vim plugins
|
|
tags: [dotfiles, dotfiles:common, vim, fzf]
|
|
ansible.builtin.git:
|
|
repo: "{{ item.repo }}"
|
|
dest: "{{ effective_user_home }}/.vim/pack/plugins/opt/{{ item.name }}"
|
|
version: "{{ item.version }}"
|
|
update: false
|
|
become_user: "{{ effective_username }}"
|
|
environment:
|
|
HOME: "{{ effective_user_home }}"
|
|
loop: "{{ vim_plugin_source_plugins | default([]) }}"
|
|
loop_control:
|
|
label: "{{ item.name }}"
|
|
when:
|
|
- vim_plugins_enabled | default(false)
|
|
- (vim_plugin_source_plugins | default([])) | length > 0
|
|
|
|
- name: Ensure AI config directories exist
|
|
tags: [dotfiles, dotfiles:common, ai_agents]
|
|
ansible.builtin.file:
|
|
path: "{{ effective_user_home }}/{{ item }}"
|
|
state: directory
|
|
owner: "{{ effective_username }}"
|
|
group: "{{ effective_user_group }}"
|
|
mode: "0755"
|
|
loop:
|
|
- .codex
|
|
when:
|
|
- "'codex' in ai_agents_deploy_enabled_names"
|
|
- (ai_agents_templates | default([])) | length > 0
|
|
|
|
- name: Render AI coding-agent templates
|
|
tags: [dotfiles, dotfiles:common, ai_agents]
|
|
ansible.builtin.template:
|
|
src: "{{ playbook_dir }}/../dotfiles/common/{{ item.src }}"
|
|
dest: "{{ effective_user_home }}/{{ item.dest }}"
|
|
owner: "{{ effective_username }}"
|
|
group: "{{ effective_user_group }}"
|
|
mode: "{{ item.mode }}"
|
|
loop: "{{ ai_agents_templates | default([]) }}"
|
|
loop_control:
|
|
label: "{{ item.dest }}"
|
|
when:
|
|
- (item.agents | intersect(ai_agents_deploy_enabled_names)) | length > 0
|
|
- (ai_agents_templates | default([])) | length > 0
|
|
|
|
- name: Refresh bat cache
|
|
tags: [dotfiles, dotfiles:common]
|
|
ansible.builtin.command:
|
|
cmd: "{{ 'batcat' if ansible_facts.os_family == 'Debian' else 'bat' }} cache --build"
|
|
become_user: "{{ effective_username }}"
|
|
environment:
|
|
HOME: "{{ effective_user_home }}"
|
|
changed_when: false
|