From 5a88d0c83e45a79c1711ca8b9154b797db28f9cc Mon Sep 17 00:00:00 2001 From: Pim Kunis Date: Sat, 26 Nov 2022 11:34:13 +0100 Subject: [PATCH] set git config --- inventory/host_vars/self.yml | 4 ++++ roles/system/tasks/main.yml | 5 +++++ roles/system/templates/.gitconfig.j2 | 5 +++++ 3 files changed, 14 insertions(+) create mode 100644 inventory/host_vars/self.yml create mode 100644 roles/system/templates/.gitconfig.j2 diff --git a/inventory/host_vars/self.yml b/inventory/host_vars/self.yml new file mode 100644 index 0000000..448c96a --- /dev/null +++ b/inventory/host_vars/self.yml @@ -0,0 +1,4 @@ +first_name: Pim +last_name: Kunis +full_name: "{{ first_name }} {{ last_name }}" +email: pim@kunis.nl diff --git a/roles/system/tasks/main.yml b/roles/system/tasks/main.yml index 5931e8e..7111206 100644 --- a/roles/system/tasks/main.yml +++ b/roles/system/tasks/main.yml @@ -14,8 +14,13 @@ - make - keepassxc - zsh + - ripgrep - name: Set default shell to zsh become: true user: name: "{{ ansible_user_id }}" shell: /usr/bin/zsh +- name: Set git configuration + template: + src: "{{ role_path }}/templates/.gitconfig.j2" + dest: "/home/{{ ansible_user_id }}/.gitconfig" diff --git a/roles/system/templates/.gitconfig.j2 b/roles/system/templates/.gitconfig.j2 new file mode 100644 index 0000000..47b96a6 --- /dev/null +++ b/roles/system/templates/.gitconfig.j2 @@ -0,0 +1,5 @@ +[user] + email = {{ email }} + name = {{ full_name }} +[core] + editor = vim