Add backup of files

This commit is contained in:
Johannes Rothe 2021-01-22 22:33:56 +01:00
parent bc57be91c4
commit 8a825c874b
4 changed files with 35 additions and 3 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
id_rsa id_rsa
id_rsa.pub id_rsa.pub
id_rsa-cert.pub
known_hosts known_hosts

View File

@ -2,16 +2,20 @@
packages_all: packages_all:
- ack - ack
- build-essential - build-essential
- dmenu
- fish - fish
- grim
- htop - htop
- ispell - ispell
- grimshot
- tmux - tmux
- sway - sway
- swaylock - swaylock
- waybar - waybar
- vim - vim
- wdisplays
packages_debian: packages_debian:
- vim - foot
packages_ubuntu: packages_ubuntu:
- vim # required for foot compilation
- meson
- ninja-build

View File

@ -1,6 +1,7 @@
set number set number
set colorcolumn=80 set colorcolumn=80
set background=dark set background=dark
set cursorline
syntax on syntax on
colorscheme monokai colorscheme monokai

View File

@ -9,6 +9,32 @@
paths: "{{ role_path }}/files/home" paths: "{{ role_path }}/files/home"
file_type: any file_type: any
register: home_files register: home_files
- name: Create a backup dir
file:
path: "~/tmp/dotfiles_backup"
state: directory
- name: Backup home files
copy:
src: "{{ item.path }}"
dest: "~/tmp/dotfiles_backup"
remote_src: True
loop: "{{ home_files.files }}"
- name: Backup config files
copy:
src: "{{ item.path }}"
dest: "~/tmp/dotfiles_backup"
remote_src: True
loop: "{{ config_files.files }}"
- name: Remove exisiting home files
file:
path: "~/.{{ item.path | basename }}/"
state: absent
loop: "{{ home_files.files }}"
- name: Remove exisiting config files
file:
path: "~/.config/{{ item.path | basename }}/"
state: absent
loop: "{{ config_files.files }}"
- name: Link home files - name: Link home files
file: file:
src: "{{ item.path }}" src: "{{ item.path }}"