mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 23:08:06 +02:00
Refactored git clone to Kevin's Package Manager (Draft not fully tested)
This commit is contained in:
33
roles/package-manager/README.md
Normal file
33
roles/package-manager/README.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# Kevins Package Manager 🤖📦
|
||||
|
||||
## Description
|
||||
|
||||
This Ansible role installs and configures [Kevin's Package Manager](https://github.com/kevinveenbirkenbach/package-manager) - a configurable Python tool designed to manage multiple repositories and automate common Git operations. The role clones the repository from GitHub, sets the executable permissions for the main script, and runs the installation command to set up command aliases.
|
||||
|
||||
## Overview
|
||||
|
||||
This role automates the deployment of Kevin's Package Manager by:
|
||||
- Cloning the repository from GitHub.
|
||||
- Setting the proper executable permissions on `main.py`.
|
||||
- Executing the installation command to create/update repository command wrappers.
|
||||
|
||||
It ensures that the Package Manager is ready to manage repositories, perform Git operations, and streamline software management tasks.
|
||||
|
||||
## Purpose
|
||||
|
||||
The purpose of this role is to simplify the installation of Kevin's Package Manager, reducing manual steps and ensuring a consistent setup across environments. Ideal for developers and system administrators, it helps integrate repository management seamlessly into your automation workflows.
|
||||
|
||||
## Features
|
||||
|
||||
- **Repository Cloning:** Automatically clones the Package Manager repository from GitHub.
|
||||
- **Executable Setup:** Sets proper permissions on the main script.
|
||||
- **Alias Installation:** Runs the installation command to generate command aliases.
|
||||
- **Configurable Paths:** Allows customization of both the installation and binary directories.
|
||||
|
||||
## 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: [MIT License](../LICENSE)
|
3
roles/package-manager/files/config.yaml.j2
Normal file
3
roles/package-manager/files/config.yaml.j2
Normal file
@@ -0,0 +1,3 @@
|
||||
directories:
|
||||
repositories: "{{repositories_directory}}"
|
||||
binaries: "{{binaries_directory}}"
|
36
roles/package-manager/meta/main.yml
Normal file
36
roles/package-manager/meta/main.yml
Normal file
@@ -0,0 +1,36 @@
|
||||
---
|
||||
galaxy_info:
|
||||
author: "Kevin Veen-Birkenbach"
|
||||
description: "Automates the installation of Kevin's Package Manager — a tool for managing multiple repositories and automating Git operations."
|
||||
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: Debian
|
||||
versions:
|
||||
- stretch
|
||||
- buster
|
||||
- bullseye
|
||||
- name: Ubuntu
|
||||
versions:
|
||||
- bionic
|
||||
- focal
|
||||
- jammy
|
||||
- name: Archlinux
|
||||
versions:
|
||||
- rolling
|
||||
galaxy_tags:
|
||||
- package-manager
|
||||
- automation
|
||||
- git
|
||||
- repositories
|
||||
- development
|
||||
repository: https://github.com/kevinveenbirkenbach/package-manager
|
||||
issue_tracker_url: https://github.com/kevinveenbirkenbach/package-manager/issues
|
||||
documentation: https://github.com/kevinveenbirkenbach/package-manager
|
||||
dependencies:
|
||||
- git
|
43
roles/package-manager/tasks/main.yml
Normal file
43
roles/package-manager/tasks/main.yml
Normal file
@@ -0,0 +1,43 @@
|
||||
---
|
||||
- name: Create installation directory for Kevin's Package Manager
|
||||
file:
|
||||
path: "{{ pkgmgr_install_path }}"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
become: yes
|
||||
when: run_once_package_manager is not defined
|
||||
|
||||
- name: Clone Kevin's Package Manager repository
|
||||
git:
|
||||
repo: "{{ pkgmgr_repo_url }}"
|
||||
dest: "{{ pkgmgr_install_path }}"
|
||||
version: "HEAD"
|
||||
force: yes
|
||||
become: yes
|
||||
when: run_once_package_manager is not defined
|
||||
|
||||
- name: Ensure main.py is executable
|
||||
file:
|
||||
path: "{{ pkgmgr_install_path }}/main.py"
|
||||
mode: '0755'
|
||||
become: yes
|
||||
when: run_once_package_manager is not defined
|
||||
|
||||
- name: create config.yaml
|
||||
template:
|
||||
src: config.yaml.j2
|
||||
dest: "{{pkgmgr_config_path}}"
|
||||
become: yes
|
||||
when: run_once_package_manager is not defined
|
||||
|
||||
- name: Run the Package Manager install command to create an alias for Kevins package manager
|
||||
command: "{{ pkgmgr_install_command }}"
|
||||
args:
|
||||
chdir: "{{ pkgmgr_install_path }}"
|
||||
become: yes
|
||||
when: run_once_package_manager is not defined
|
||||
|
||||
- name: run run_once_package_manager tasks once
|
||||
set_fact:
|
||||
run_once_package_managerr: true
|
||||
when: run_once_package_manager is not defined
|
20
roles/package-manager/vars/main.yml
Normal file
20
roles/package-manager/vars/main.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
# Variables for Kevin's Package Manager installation
|
||||
|
||||
# The Git repository URL for Kevin's Package Manager
|
||||
pkgmgr_repo_url: "https://github.com/kevinveenbirkenbach/package-manager.git"
|
||||
|
||||
# Directory which contains all Repositories managed by Kevin's Package Manager
|
||||
repositories_directory: "/opt/Repositories/"
|
||||
|
||||
# The directory where the repository will be cloned
|
||||
pkgmgr_install_path: "{{repositories_directory}}github.com/kevinveenbirkenbach/package-manager"
|
||||
|
||||
# File containing the configuration
|
||||
pkgmgr_config_path: "{{pkgmgr_install_path}}/config/config.yaml"
|
||||
|
||||
# The directory where executable aliases will be installed (ensure it's in your PATH)
|
||||
binaries_directory: "/usr/local/bin"
|
||||
|
||||
# The command to run to install/update the Package Manager's aliases
|
||||
pkgmgr_install_command: "./main.py install pkgmgr"
|
Reference in New Issue
Block a user