diff --git a/configs.yml b/configs.yml index 3635650..d9f95a3 100644 --- a/configs.yml +++ b/configs.yml @@ -25,8 +25,6 @@ grub: sudo grub-mkconfig -o /boot/grub/grub.cfg git: - - install: - - git - run: - . ./secrets && git config --global user.name "${USER}@$(uname -n)"; @@ -42,9 +40,6 @@ git: git config --global alias.df "diff --word-diff=color"; git config --global diff.tool vimdiff; git config --global init.defaultBranch "main" - - symlink: - - dotfiles/git/ignore - - ~/.config/git/ignore etckeeper: - install: diff --git a/playbook.yml b/playbook.yml index 2748b87..a71229a 100644 --- a/playbook.yml +++ b/playbook.yml @@ -4,6 +4,8 @@ roles: - role: base tags: base + - role: git + tags: git - role: bash tags: bash - role: zsh diff --git a/dotfiles/git/ignore b/roles/git/files/ignore similarity index 100% rename from dotfiles/git/ignore rename to roles/git/files/ignore diff --git a/roles/git/tasks/main.yml b/roles/git/tasks/main.yml new file mode 100644 index 0000000..dda6851 --- /dev/null +++ b/roles/git/tasks/main.yml @@ -0,0 +1,20 @@ +--- + +- name: Install git (Archlinux) + become: true + pacman: + name: + - git + when: ansible_distribution == 'Archlinux' + +- name: Install git (Debian) + become: true + apt: + name: + - git + when: ansible_distribution == 'Debian' + +- name: Copy global gitignore + copy: + src: ignore + dest: ~/.config/git/ignore