From 166dd1442c9ce93b996819929fe0b85741b496f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Sun, 11 Feb 2018 12:03:40 +0100 Subject: [PATCH] Handle dotfiles with ansible --- dotfiles.yml | 29 +++++++++++++++++++++++++++++ playbook.yml | 20 ++++++++++++++++++-- 2 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 dotfiles.yml diff --git a/dotfiles.yml b/dotfiles.yml new file mode 100644 index 0000000..55bb41c --- /dev/null +++ b/dotfiles.yml @@ -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 diff --git a/playbook.yml b/playbook.yml index 9155a18..b27d50f 100644 --- a/playbook.yml +++ b/playbook.yml @@ -115,8 +115,24 @@ ExecStart=-/sbin/agetty --autologin {{ user }} --noclear %I $TERM become: true - - name: run dotbot - command: ./dotbot + - name: load dotfile list + 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 file: