From cde39970eb41e32648fc01a08babbc91048c1a93 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Wed, 29 Nov 2023 21:27:17 +0100 Subject: [PATCH] add on-off-playbook: remove dotfiles (#621) Reviewed-on: https://git.mgrote.net/mg/homeserver/pulls/621 Co-authored-by: Michael Grote Co-committed-by: Michael Grote --- playbooks/on-off/remove_dotfiles.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 playbooks/on-off/remove_dotfiles.yml diff --git a/playbooks/on-off/remove_dotfiles.yml b/playbooks/on-off/remove_dotfiles.yml new file mode 100644 index 00000000..d9bcc7ec --- /dev/null +++ b/playbooks/on-off/remove_dotfiles.yml @@ -0,0 +1,22 @@ +--- +- hosts: all + become: true + tasks: + - name: remove files + ansible.builtin.file: + path: "{{ item }}" + state: absent + loop: + - /home/mg/.gitconfig + - /home/mg/.tmux.conf + - /home/mg/.vimrc + - /home/mg/dotfiles + + - name: remove from .bashrc + ansible.builtin.lineinfile: + path: "{{ item }}" + state: absent + line: "source /home/mg/dotfiles/.bash_extra" + loop: + - /root/.bashrc + - /home/mg/.bashrc