From b02a8c40c76cb2e61c7a664ec156407101201a24 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Wed, 25 Jan 2023 14:40:44 +0100 Subject: move tool existence conditionals to role common --- roles/etckeeper/tasks/main.yml | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) (limited to 'roles/etckeeper') diff --git a/roles/etckeeper/tasks/main.yml b/roles/etckeeper/tasks/main.yml index 3e37ed1..0339c61 100644 --- a/roles/etckeeper/tasks/main.yml +++ b/roles/etckeeper/tasks/main.yml @@ -1,22 +1,15 @@ - become: true block: - - name: Check if /etc is versioned - stat: - path: /etc/.git/config - register: etc_versioned + - name: Set user.name + community.general.git_config: + scope: local + repo: /etc + name: user.name + value: '{{ git_name }}' - - when: etc_versioned - block: - - name: Set user.name - community.general.git_config: - scope: local - repo: /etc - name: user.name - value: '{{ git_name }}' - - - name: Set user.email - community.general.git_config: - scope: local - repo: /etc - name: user.email - value: '{{ git_email }}' + - name: Set user.email + community.general.git_config: + scope: local + repo: /etc + name: user.email + value: '{{ git_email }}' -- cgit v1.2.3