Handle dotfiles with ansible

This commit is contained in:
2018-02-11 12:03:40 +01:00
parent 959212c9cb
commit 166dd1442c
2 changed files with 47 additions and 2 deletions

29
dotfiles.yml Normal file
View File

@@ -0,0 +1,29 @@
dotfiles:
- from: autostart
to: .autostart
- from: git/gitconfig
to: .gitconfig
- from: gnupg/dirmngr.conf
to: .gnupg/dirmngr.conf
- from: gnupg/gpg-agent.conf
to: .gnupg/gpg-agent.conf
- from: gnupg/gpg.conf
to: .gnupg/gpg.conf
- from: i3
to: .i3
- from: tmux/tmux.conf
to: .tmux.conf
- from: vim/vimrc
to: .config/nvim/init.vim
- from: vim/vimrc
to: .vimrc
- from: x/Xresources
to: .Xresources
- from: x/xinitrc
to: .xinitrc
- from: zsh/zprofile
to: .zprofile
- from: zsh/zshrc
to: .zshrc
- from: zsh/zshrc.d
to: .zshrc.d

View File

@@ -115,8 +115,24 @@
ExecStart=-/sbin/agetty --autologin {{ user }} --noclear %I $TERM ExecStart=-/sbin/agetty --autologin {{ user }} --noclear %I $TERM
become: true become: true
- name: run dotbot - name: load dotfile list
command: ./dotbot include_vars:
file: dotfiles.yml
- name: link this folder to ~/.dotfiles
file:
state: link
force: true
path: "{{ ansible_user_dir }}/.dotfiles"
src: "{{ playbook_dir }}"
- name: link dotfiles
file:
state: link
force: true
path: "{{ ansible_user_dir }}/{{ item.to }}"
src: ~/.dotfiles/{{ item.from }}
with_items: "{{ dotfiles }}"
- name: create directories - name: create directories
file: file: