Optimized portfolio and pkgmgr update procedures

This commit is contained in:
2025-04-10 14:07:50 +02:00
parent 150e15625d
commit 2ca000795d
43 changed files with 334 additions and 334 deletions

32
roles/pkgmgr/README.md Normal file
View File

@@ -0,0 +1,32 @@
# 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)

View File

@@ -0,0 +1,37 @@
---
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:
- pkgmgr
- 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
- make

View File

@@ -0,0 +1,50 @@
---
- name: Ensure GitHub host key is in known_hosts
known_hosts:
path: "~/.ssh/known_hosts"
name: github.com
key: "{{ lookup('pipe', 'ssh-keyscan -t ed25519 github.com | grep -v \"^#\"') }}"
become: yes
- 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: "make setup"
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

View File

@@ -0,0 +1,3 @@
directories:
repositories: "{{repositories_directory}}"
binaries: "{{binaries_directory}}"

View File

@@ -0,0 +1,17 @@
---
# 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"