diff --git a/local/main.yml b/local/main.yml
index 6096a16..5aad87c 100644
--- a/local/main.yml
+++ b/local/main.yml
@@ -11,19 +11,45 @@
# this repo often has local changes
ignore_errors: true # noqa: ignore-errors
- - name: Symlink dotfiles
- block:
- - name: List dotfiles # noqa: risky-shell-pipe
- ansible.builtin.shell: ls -A ~/.dotfiles | grep '^\.'
- register: ls_dotfiles
- changed_when: false
+ - name: Symlink shallow dotfiles
+ ansible.builtin.file:
+ src: ~/.dotfiles/{{ item }}
+ dest: ~/{{ item }}
+ state: link
+ loop:
+ - .config
+ - .digrc
+ - .gemrc
+ - .gitconfig
+ - .hammerspoon
+ - .inputrc
+ - .local
+ - .p10k.zsh
+ - .profile
+ - .ruby-version
+ - .tmux.conf
+ - .zsh
+ - .zshenv
+ - .zshrc
- - name: Symlink dotfiles
+ - name: Symlink deep dotfiles
+ block:
+ - name: Ensure directory exists
+ ansible.builtin.file:
+ dest: ~/{{ item | dirname }}
+ state: directory
+ loop: "{{ dotfiles }}"
+ - name: Symlink dotfile
ansible.builtin.file:
src: ~/.dotfiles/{{ item }}
dest: ~/{{ item }}
state: link
- loop: "{{ ls_dotfiles.stdout_lines | difference(['.git', '.gitmodules', '.DS_Store']) }}"
+ loop: "{{ dotfiles }}"
+ vars:
+ dotfiles:
+ - .bundle/config
+ - .cargo/config.toml
+ - .docker/config.json
- import_playbook: macos.yml # noqa: name[play]