aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roles/my_workspace
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2023-12-10 11:42:25 +0100
committerEgor Tensin <egor@tensin.name>2023-12-10 12:20:38 +0100
commit1e3037abc23aafab5c8dde6035cb8d5383c6dafc (patch)
treed80f1d313a88667e42c36aae62535a84f1ee8aea /roles/my_workspace
parentletsencrypt: re-request certificates on email change (diff)
downloadinfra-ansible-1e3037abc23aafab5c8dde6035cb8d5383c6dafc.tar.gz
infra-ansible-1e3037abc23aafab5c8dde6035cb8d5383c6dafc.zip
my_workspace: configure git repositories separately
Configuring git globally can interfere with my_dotfiles; seems more generic that way anyway.
Diffstat (limited to '')
-rw-r--r--roles/my_workspace/tasks/main.yml14
-rw-r--r--roles/my_workspace/tasks/project.yml12
2 files changed, 12 insertions, 14 deletions
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'