mirror of
https://github.com/fscotto/infra.git
synced 2026-05-30 23:49:56 +00:00
Add workstation-specific dotfiles support
This commit is contained in:
@@ -52,3 +52,16 @@ workstation_user_directories:
|
||||
mode: "0755"
|
||||
- path: "{{ user_home }}/.local/bin"
|
||||
mode: "0755"
|
||||
|
||||
workstation_dotfiles:
|
||||
- src: .gitignore_global
|
||||
dest: .gitignore_global
|
||||
mode: "0644"
|
||||
- src: .themes.gitignore
|
||||
dest: .themes.gitignore
|
||||
mode: "0644"
|
||||
|
||||
workstation_templates:
|
||||
- src: workstation/.gitconfig.j2
|
||||
dest: .gitconfig
|
||||
mode: "0644"
|
||||
|
||||
@@ -10,3 +10,27 @@
|
||||
loop: "{{ workstation_user_directories | default([]) }}"
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
|
||||
- name: Copy workstation dotfiles
|
||||
tags: [dotfiles, dotfiles:workstation]
|
||||
ansible.builtin.copy:
|
||||
src: "{{ playbook_dir }}/../dotfiles/workstation/{{ item.src }}"
|
||||
dest: "{{ user_home }}/{{ item.dest }}"
|
||||
owner: "{{ username }}"
|
||||
group: "{{ user_group }}"
|
||||
mode: "{{ item.mode }}"
|
||||
loop: "{{ workstation_dotfiles | default([]) }}"
|
||||
loop_control:
|
||||
label: "{{ item.dest }}"
|
||||
|
||||
- name: Render workstation templates
|
||||
tags: [dotfiles, dotfiles:workstation]
|
||||
ansible.builtin.template:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ user_home }}/{{ item.dest }}"
|
||||
owner: "{{ username }}"
|
||||
group: "{{ user_group }}"
|
||||
mode: "{{ item.mode }}"
|
||||
loop: "{{ workstation_templates | default([]) }}"
|
||||
loop_control:
|
||||
label: "{{ item.dest }}"
|
||||
|
||||
@@ -21,6 +21,12 @@
|
||||
|
||||
- hosts: ubuntu_workstation
|
||||
become: true
|
||||
pre_tasks:
|
||||
- name: Load local vault variables when available
|
||||
tags: [always]
|
||||
ansible.builtin.include_vars:
|
||||
file: "{{ playbook_dir }}/../secrets/vault.yml"
|
||||
when: lookup('ansible.builtin.fileglob', playbook_dir + '/../secrets/vault.yml', errors='ignore') != ''
|
||||
|
||||
roles:
|
||||
- packages_ubuntu
|
||||
|
||||
82
ansible/templates/workstation/.gitconfig.j2
Normal file
82
ansible/templates/workstation/.gitconfig.j2
Normal file
@@ -0,0 +1,82 @@
|
||||
[init]
|
||||
defaultBranch = main
|
||||
|
||||
[core]
|
||||
excludesfile = ~/.gitignore_global
|
||||
pager = delta
|
||||
|
||||
[user]
|
||||
name = {{ vault_personal_full_name }}
|
||||
email = {{ vault_git_work_email }}
|
||||
|
||||
[fetch]
|
||||
prune = true
|
||||
|
||||
[remote "origin"]
|
||||
prune = true
|
||||
|
||||
[pull]
|
||||
rebase = true
|
||||
|
||||
[commit]
|
||||
gpgsign = false
|
||||
|
||||
[merge]
|
||||
conflictstyle = diff3
|
||||
tool = meld
|
||||
|
||||
[mergetool]
|
||||
prompt = false
|
||||
|
||||
[diff]
|
||||
tool = meld
|
||||
|
||||
[color]
|
||||
ui = always
|
||||
|
||||
[color "status"]
|
||||
branch = magenta
|
||||
untracked = cyan
|
||||
unmerged = yellow bold
|
||||
|
||||
[color "diff"]
|
||||
frag = magenta bold
|
||||
old = red bold
|
||||
new = green bold
|
||||
whitespace = red reverse
|
||||
|
||||
[color "diff-highlight"]
|
||||
oldNormal = red bold
|
||||
oldHighlight = red bold 52
|
||||
newNormal = green bold
|
||||
newHighlight = green bold 52
|
||||
|
||||
[help]
|
||||
autocorrect = 30
|
||||
|
||||
[interactive]
|
||||
diffFilter = delta --color-only
|
||||
|
||||
[alias]
|
||||
co = checkout
|
||||
br = branch
|
||||
ci = commit
|
||||
st = status
|
||||
ld = log -p
|
||||
lg = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)%n' --all
|
||||
glog = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'
|
||||
onelinegraph = log --oneline --graph --decorate
|
||||
undo = reset --soft HEAD~1
|
||||
stash-all = stash save --include-untracked
|
||||
expireunreachablenow = reflog expire --expire-unreachable=now --all
|
||||
gcunreachablenow = gc --prune=now
|
||||
|
||||
[include]
|
||||
path = ~/.themes.gitignore
|
||||
|
||||
[delta]
|
||||
features = catppuccin-mocha navigate
|
||||
true-color = always
|
||||
colorMoved = default
|
||||
tabs = 4
|
||||
side-by-side = true
|
||||
Reference in New Issue
Block a user