From 1e3037abc23aafab5c8dde6035cb8d5383c6dafc Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sun, 10 Dec 2023 11:42:25 +0100 Subject: my_workspace: configure git repositories separately Configuring git globally can interfere with my_dotfiles; seems more generic that way anyway. --- roles/my_workspace/tasks/main.yml | 14 -------------- roles/my_workspace/tasks/project.yml | 12 ++++++++++++ 2 files changed, 12 insertions(+), 14 deletions(-) (limited to 'roles') diff --git a/roles/my_workspace/tasks/main.yml b/roles/my_workspace/tasks/main.yml index 462c8da..1393a43 100644 --- a/roles/my_workspace/tasks/main.yml +++ b/roles/my_workspace/tasks/main.yml @@ -15,20 +15,6 @@ - make state: present -- name: Configure git - block: - - name: Set user.name - community.general.git_config: - scope: global - name: user.name - value: '{{ my_workspace_git_name }}' - - - name: Set user.email - community.general.git_config: - scope: global - name: user.email - value: '{{ my_workspace_git_email }}' - - name: Update projects ansible.builtin.include_tasks: project.yml loop: '{{ my_workspace_projects }}' diff --git a/roles/my_workspace/tasks/project.yml b/roles/my_workspace/tasks/project.yml index cd21ddb..e788eef 100644 --- a/roles/my_workspace/tasks/project.yml +++ b/roles/my_workspace/tasks/project.yml @@ -10,6 +10,18 @@ dest: '{{ project_dir }}' accept_hostkey: true + - name: Configure git repository + community.general.git_config: + scope: local + repo: '{{ project_dir }}' + name: '{{ item.name }}' + value: '{{ item.value }}' + loop: + - name: user.name + value: '{{ my_workspace_git_name }}' + - name: user.email + value: '{{ my_workspace_git_email }}' + - name: Check for Makefile ansible.builtin.file: path: '{{ project_dir }}/Makefile' -- cgit v1.2.3