From 445c94788e8dea0abd9d065717d0cc02eb3733e4 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Sat, 6 Sep 2025 10:46:39 +0200 Subject: [PATCH] Refactor: consolidate pkgmgr updates and remove legacy roles Details: - Added pkgmgr update task directly in pkgmgr role (pkgmgr pull --all) - Removed deprecated update-pkgmgr role and references - Removed deprecated update-pip role and references - Simplified update-compose by dropping update-pkgmgr include https://chatgpt.com/share/68bbeff1-27a0-800f-bef3-03ab597595fd --- roles/pkgmgr/tasks/01_core.yml | 4 ++++ roles/update-compose/tasks/01_core.yml | 4 ---- roles/update-pip/README.md | 23 ---------------------- roles/update-pip/meta/main.yml | 25 ------------------------ roles/update-pip/tasks/main.yml | 9 --------- roles/update-pip/vars/main.yml | 1 - roles/update-pkgmgr/README.md | 27 -------------------------- roles/update-pkgmgr/TODO.md | 2 -- roles/update-pkgmgr/meta/main.yml | 24 ----------------------- roles/update-pkgmgr/tasks/main.yml | 3 --- roles/update-pkgmgr/vars/main.yml | 1 - 11 files changed, 4 insertions(+), 119 deletions(-) delete mode 100644 roles/update-pip/README.md delete mode 100644 roles/update-pip/meta/main.yml delete mode 100644 roles/update-pip/tasks/main.yml delete mode 100644 roles/update-pip/vars/main.yml delete mode 100644 roles/update-pkgmgr/README.md delete mode 100644 roles/update-pkgmgr/TODO.md delete mode 100644 roles/update-pkgmgr/meta/main.yml delete mode 100644 roles/update-pkgmgr/tasks/main.yml delete mode 100644 roles/update-pkgmgr/vars/main.yml diff --git a/roles/pkgmgr/tasks/01_core.yml b/roles/pkgmgr/tasks/01_core.yml index ed0b194e..8c5b124b 100644 --- a/roles/pkgmgr/tasks/01_core.yml +++ b/roles/pkgmgr/tasks/01_core.yml @@ -43,3 +43,7 @@ chdir: "{{ PKGMGR_INSTALL_PATH }}" executable: /bin/bash become: true + +- name: "Update all repositories with pkgmgr" + command: "pkgmgr pull --all" + when: MODE_UPDATE | bool \ No newline at end of file diff --git a/roles/update-compose/tasks/01_core.yml b/roles/update-compose/tasks/01_core.yml index 7d3ad150..0ecdd9f3 100644 --- a/roles/update-compose/tasks/01_core.yml +++ b/roles/update-compose/tasks/01_core.yml @@ -44,7 +44,3 @@ register: pkgmgr_available failed_when: false -- name: "Update all repositories using pkgmgr" - include_role: - name: update-pkgmgr - when: pkgmgr_available.rc == 0 diff --git a/roles/update-pip/README.md b/roles/update-pip/README.md deleted file mode 100644 index b26f2ac6..00000000 --- a/roles/update-pip/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# Update Pip Packages - -## Description - -This Ansible role automatically updates all installed Python Pip packages to their latest versions. - -## Overview - -The role performs the following: -- Executes a command to retrieve all installed Python Pip packages. -- Updates each package individually to its latest available version. -- Ensures a smooth and automated Python environment maintenance process. - -## Purpose - -Ensures Python packages remain up-to-date, improving security and functionality. - -## Features - -- **Automatic Updates:** Automates the process of upgrading Python packages. -- **Platform Independent:** Works on Linux, macOS, and Windows environments. -- **Ansible Integration:** Easy to include in larger playbooks or maintenance routines. - diff --git a/roles/update-pip/meta/main.yml b/roles/update-pip/meta/main.yml deleted file mode 100644 index 22f5afc3..00000000 --- a/roles/update-pip/meta/main.yml +++ /dev/null @@ -1,25 +0,0 @@ -galaxy_info: - author: "Kevin Veen-Birkenbach" - license: "Infinito.Nexus NonCommercial License" - license_url: "https://s.infinito.nexus/license" - company: | - Kevin Veen-Birkenbach - Consulting & Coaching Solutions - https://www.veen.world - description: "Automatically updates all Python Pip packages to their latest available versions." - min_ansible_version: "2.9" - platforms: - - name: Ubuntu - versions: - - all - - name: Archlinux - versions: - - rolling - - name: Debian - versions: - - all - galaxy_tags: - - python - - pip - - update - - maintenance diff --git a/roles/update-pip/tasks/main.yml b/roles/update-pip/tasks/main.yml deleted file mode 100644 index 87fe5b71..00000000 --- a/roles/update-pip/tasks/main.yml +++ /dev/null @@ -1,9 +0,0 @@ -- block: - - name: Include dependency 'dev-python-pip' - include_role: - name: dev-python-pip - when: run_once_dev_python_pip is not defined - - include_tasks: utils/run_once.yml - vars: - flush_handlers: false - when: run_once_update_pip is not defined diff --git a/roles/update-pip/vars/main.yml b/roles/update-pip/vars/main.yml deleted file mode 100644 index 8586b633..00000000 --- a/roles/update-pip/vars/main.yml +++ /dev/null @@ -1 +0,0 @@ -application_id: update-pip diff --git a/roles/update-pkgmgr/README.md b/roles/update-pkgmgr/README.md deleted file mode 100644 index c7fcd051..00000000 --- a/roles/update-pkgmgr/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# Update pkgmgr - -## Description - -This role checks if the [package manager](https://github.com/kevinveenbirkenbach/package-manager) is available on the system. If so, it runs `pkgmgr update --all` to update all repositories managed by the `pkgmgr`. - -## Overview - -This role performs the following tasks: -- Checks if the `pkgmgr` command is available. -- If available, runs `pkgmgr update --all` to update all repositories. - -## Purpose - -The purpose of this role is to simplify system updates by using the `pkgmgr` package manager to handle all repository updates with a single command. - -## Features - -- **Conditional Execution**: Runs only if the `pkgmgr` command is found on the system. -- **Automated Updates**: Automatically runs `pkgmgr update --all` to update all repositories. - -## License - -Infinito.Nexus NonCommercial License -[Learn More](https://s.infinito.nexus/license) - - diff --git a/roles/update-pkgmgr/TODO.md b/roles/update-pkgmgr/TODO.md deleted file mode 100644 index 8bb28ea8..00000000 --- a/roles/update-pkgmgr/TODO.md +++ /dev/null @@ -1,2 +0,0 @@ -# Todos -- Activate update again. Atm not possible, because it pulls all repos \ No newline at end of file diff --git a/roles/update-pkgmgr/meta/main.yml b/roles/update-pkgmgr/meta/main.yml deleted file mode 100644 index 9d7f4f2e..00000000 --- a/roles/update-pkgmgr/meta/main.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- -galaxy_info: - author: "Kevin Veen-Birkenbach" - description: "Checks if the pkgmgr command is available and runs 'pkgmgr update --all' to update all repositories." - license: "Infinito.Nexus NonCommercial License" - license_url: "https://s.infinito.nexus/license" - company: | - Kevin Veen-Birkenbach - Consulting & Coaching Solutions - https://www.veen.world - min_ansible_version: "2.9" - platforms: - - name: Linux - versions: - - all - galaxy_tags: - - update - - pkgmgr - - pkgmgr - - system - repository: "https://s.infinito.nexus/code" - issue_tracker_url: "https://s.infinito.nexus/issues" - documentation: "https://docs.infinito.nexus" -dependencies: [] \ No newline at end of file diff --git a/roles/update-pkgmgr/tasks/main.yml b/roles/update-pkgmgr/tasks/main.yml deleted file mode 100644 index 5cdd2c40..00000000 --- a/roles/update-pkgmgr/tasks/main.yml +++ /dev/null @@ -1,3 +0,0 @@ -# run_once_update_pkgmgr: deactivated -#- name: "Update all repositories with pkgmgr" -# command: "pkgmgr update --all" diff --git a/roles/update-pkgmgr/vars/main.yml b/roles/update-pkgmgr/vars/main.yml deleted file mode 100644 index 98ad566a..00000000 --- a/roles/update-pkgmgr/vars/main.yml +++ /dev/null @@ -1 +0,0 @@ -application_id: update-pkgmgr