From 3ad81ae8ae27b17e3ffdcaad050c960765f336dd Mon Sep 17 00:00:00 2001 From: "flyingscorpio@clevo" Date: Tue, 22 Feb 2022 13:23:22 +0100 Subject: [PATCH] toansible: Start adding git installation --- configs.yml | 5 ----- playbook.yml | 2 ++ {dotfiles/git => roles/git/files}/ignore | 0 roles/git/tasks/main.yml | 20 ++++++++++++++++++++ 4 files changed, 22 insertions(+), 5 deletions(-) rename {dotfiles/git => roles/git/files}/ignore (100%) create mode 100644 roles/git/tasks/main.yml 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