Refactored git clone to Kevin's Package Manager (Draft not fully tested)

This commit is contained in:
2025-04-01 14:40:04 +02:00
parent 659c24eb14
commit 526f1c952d
21 changed files with 229 additions and 48 deletions

27
roles/git/README.md Normal file
View File

@@ -0,0 +1,27 @@
# Git
## Description
This Ansible role installs Git on the target system using the Pacman package manager. It ensures that Git is installed only once, even when the role is applied to multiple hosts or executed in a multi-task scenario.
## Overview
Designed for Arch Linux systems, this role leverages the `pacman` module to install Git. It uses a fact (`run_once_git`) to control task execution, ensuring that the Git installation is performed only once per run.
## Purpose
The purpose of this role is to automate the installation of Git in a consistent and idempotent manner. It is especially useful in environments where Git is a prerequisite for further automation or development tasks.
## Features
- **Git Installation:** Uses the Pacman package manager to install Git.
- **Idempotent Execution:** Sets a fact to guarantee that the installation tasks are executed only once.
- **Optimized Deployment:** Suitable for use in multi-host environments to avoid redundant installations.
## Credits 📝
Developed and maintained by **Kevin Veen-Birkenbach**.
Learn more at [www.veen.world](https://www.veen.world)
Part of the [CyMaIS Project](https://github.com/kevinveenbirkenbach/cymais)
License: [CyMaIS NonCommercial License (CNCL)](https://s.veen.world/cncl)

21
roles/git/meta/main.yml Normal file
View File

@@ -0,0 +1,21 @@
---
galaxy_info:
author: "Kevin Veen-Birkenbach"
description: "Installs Git using the Pacman package manager on Arch Linux systems."
license: "CyMaIS NonCommercial License (CNCL)"
license_url: "https://s.veen.world/cncl"
company: |
Kevin Veen-Birkenbach
Consulting & Coaching Solutions
https://www.veen.world
min_ansible_version: "2.9"
platforms:
- name: Archlinux
versions:
- rolling
galaxy_tags:
- git
- pacman
- archlinux
- installation
dependencies: []

View File

@@ -1,5 +1,7 @@
- name: install git
pacman: name=git state=present
pacman:
name: git
state: present
when: run_once_git is not defined
- name: run the git tasks once