From bb4d6a1c829d235e857f95eb670c5a2b51d2fa94 Mon Sep 17 00:00:00 2001 From: Markus Pesch Date: Wed, 20 Dec 2023 12:05:23 +0100 Subject: [PATCH] fix: add option to install mergetool --- defaults/main.yml | 4 +++- tasks/main.yml | 17 +++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 5e9823b..efa76fa 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,5 +1,8 @@ --- +git_install_merge_tool: false +git_package_name_merge_tool: meld + git_users: [] # github: # config: @@ -9,4 +12,3 @@ git_users: [] # name: "root" # email: root@localhost # signingKey: gpg-fingerprint - \ No newline at end of file diff --git a/tasks/main.yml b/tasks/main.yml index f483be1..9f8b64e 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -4,10 +4,19 @@ ansible.builtin.include_vars: "{{ ansible_os_family }}.yml" - name: Install git and dependencies - ansible.builtin.package: - name: "{{ item }}" - state: present - with_items: "{{ git_package_names }}" + vars: + _git_package_names: "{{ git_package_names }}" + block: + - name: Add merge tool + ansible.builtin.set_fact: + _git_package_names: "{{ _git_package_names + [ git_package_name_merge_tool ] }}" + when: git_install_merge_tool is defined and + git_install_merge_tool + - name: Install git and dependencies + ansible.builtin.package: + name: "{{ item }}" + state: present + with_items: "{{ _git_package_names }}" - name: Configure git ansible.builtin.include_tasks: git_user.yml