- name: Ensure dotfiles directory git: repo: git@gitea.nehrke.info:nemoinho/dotfiles.git dest: "{{ lookup('env', 'HOME') ~ '/dotfiles' }}" - name: Ensure pre-commit hook to automatically remove links of deleted dotfiles copy: src: pre-commit-hook.sh dest: "{{ lookup('env', 'HOME') ~ '/dotfiles/.git/hooks/pre-commit' }}" mode: u=rwx,g=rx,o=r - name: Ensure dotfiles are up-to-date shell: | stow --adopt . [ -n "$(git status --short)" ] && git stash || true args: chdir: "{{ lookup('env', 'HOME') ~ '/dotfiles' }}" executable: /bin/bash