From 1b66f93d77c76211d8cc06642c408deae9882f42 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Mon, 1 Aug 2022 18:15:50 -0500 Subject: [PATCH] feat: add git role --- playbook.yml | 3 ++- roles/git/tasks/install-git.yml | 29 +++++++++++++++++++++++++++++ roles/git/tasks/main.yml | 2 ++ 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 roles/git/tasks/install-git.yml diff --git a/playbook.yml b/playbook.yml index e37083f..b5e3861 100644 --- a/playbook.yml +++ b/playbook.yml @@ -1,5 +1,6 @@ --- -- name: Deploy ZSH Dependencies +- name: INstall Dependencies hosts: all roles: + - role: git - role: zsh diff --git a/roles/git/tasks/install-git.yml b/roles/git/tasks/install-git.yml new file mode 100644 index 0000000..13b558a --- /dev/null +++ b/roles/git/tasks/install-git.yml @@ -0,0 +1,29 @@ +--- +- name: Install git for MacOS + community.general.homebrew: + name: git + state: preset + when: ansible_facts.distribution == 'MacOSX' + +- name: Install git for Debian based systems + become: true + ansible.builtin.apt: + name: git + state: present + when: ansible_facts.os_family == 'Debian' + +- name: Enable EPL for RedHat based systems + ansible.builtin.import_tasks: enable-epel.yml + +- name: Install git for RedHat based systems + become: true + ansible.builtin.dnf: + name: git + state: present + when: ansible_facts.os_family == 'RedHat' + +- name: Install git for Arch + community.general.pacman: + name: git + state: present + when: ansible_facts.distribution == 'Archlinux' diff --git a/roles/git/tasks/main.yml b/roles/git/tasks/main.yml index 653e9ef..df18ac3 100644 --- a/roles/git/tasks/main.yml +++ b/roles/git/tasks/main.yml @@ -1,2 +1,4 @@ --- # tasks file for git +- name: Install Git + ansible.builtin.import_tasks: install-git.yml