From 4541e2d636a49c072b7c7ba845b7b6eb2a85e341 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Tue, 1 Apr 2025 11:23:36 +0200 Subject: [PATCH] Updated pc roles and implemented update-pip role --- roles/pc-administrator-tools/README.md | 39 ---------------- roles/pc-bluray-player-tools/README.md | 44 ++++++++++++++++--- roles/pc-docker/tasks/main.yml | 7 +-- roles/pc-git/README.md | 20 --------- roles/pc-office/README.md | 2 +- roles/pc-office/meta/main.yml | 2 +- .../README.md | 8 ++-- .../meta/main.yml | 0 .../tasks/main.yml | 0 roles/system-aur-helper/README.md | 1 + roles/update-pip/README.md | 23 ++++++++++ roles/update-pip/meta/main.yml | 26 +++++++++++ roles/update-pip/tasks/main.yml | 4 ++ roles/update/tasks/main.yml | 13 +++++- 14 files changed, 114 insertions(+), 75 deletions(-) delete mode 100644 roles/pc-administrator-tools/README.md rename roles/{pc-video-conference => pc-zoom}/README.md (69%) rename roles/{pc-video-conference => pc-zoom}/meta/main.yml (100%) rename roles/{pc-video-conference => pc-zoom}/tasks/main.yml (100%) create mode 100644 roles/update-pip/README.md create mode 100644 roles/update-pip/meta/main.yml create mode 100644 roles/update-pip/tasks/main.yml diff --git a/roles/pc-administrator-tools/README.md b/roles/pc-administrator-tools/README.md deleted file mode 100644 index 3abff310..00000000 --- a/roles/pc-administrator-tools/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# PC-Bluray-Player-Tools Role - -## Overview -Welcome to the `pc-bluray-player-tools` role, a part of the `cymais` repository. This role is dedicated to setting up software required for Blu-ray playback on personal computers. It focuses on installing necessary packages to enable the use of Blu-ray media with VLC player and other compatible software. - -## Role Contents -The `main.yml` file in this role consists of tasks that automate the installation of the following packages: -1. **Install VLC and Blu-ray Software**: - - `vlc`: A versatile media player that supports Blu-ray playback. - - `libaacs`: A library for Blu-ray disc encryption handling. - - `libbluray`: A library for Blu-ray disc playback support. - -There are commented-out tasks for installing additional AUR packages, such as `aacskeys` and `libbdplus`, which can be enabled as per the user's requirements. - -## Other Resources and Resources -For more in-depth information and guidance on Blu-ray playback and software configuration, the following resources can be consulted: -- [Arch Linux Wiki on Blu-ray](https://wiki.archlinux.org/title/Blu-ray#Using_aacskeys) -- [Guide to Play Blu-ray with VLC](https://videobyte.de/play-blu-ray-with-vlc) -- [Manjaro Forum Discussion on Blu-ray UHD Playback](https://archived.forum.manjaro.org/t/wie-kann-ich-bluray-uhd-abspielen/127396/12) -- [FV Online DB](http://fvonline-db.bplaced.net/) - -## Dependencies -This role depends on the `java` role, which ensures the Java runtime is available – a requirement for certain Blu-ray playback tools and functionalities. - -## Prerequisites -- **Ansible**: Ansible must be installed on your system to use this role. -- **Arch Linux-based System**: Designed for Arch Linux distributions, using the `pacman` package manager. - -## Running the Role -To utilize this role: -1. Clone the `cymais` repository. -2. Navigate to the `roles/pc-bluray-player-tools` directory. -3. Execute the role using Ansible, with appropriate permissions for installing packages. - -## Customization -You can customize this role by enabling or adding additional tasks for other AUR packages related to Blu-ray playback as needed. - -## Support and Contributions -For support, feedback, or contributions to enhance the role's capabilities, please open an issue or submit a pull request in the `cymais` repository. Contributions that improve Blu-ray playback support or compatibility are highly appreciated. \ No newline at end of file diff --git a/roles/pc-bluray-player-tools/README.md b/roles/pc-bluray-player-tools/README.md index 61516b11..3abff310 100644 --- a/roles/pc-bluray-player-tools/README.md +++ b/roles/pc-bluray-player-tools/README.md @@ -1,7 +1,39 @@ -# collection-blu-ray-player +# PC-Bluray-Player-Tools Role -## Other Resources -- https://wiki.archlinux.org/title/Blu-ray#Using_aacskeys -- https://videobyte.de/play-blu-ray-with-vlc -- https://archived.forum.manjaro.org/t/wie-kann-ich-bluray-uhd-abspielen/127396/12 -- http://fvonline-db.bplaced.net/ \ No newline at end of file +## Overview +Welcome to the `pc-bluray-player-tools` role, a part of the `cymais` repository. This role is dedicated to setting up software required for Blu-ray playback on personal computers. It focuses on installing necessary packages to enable the use of Blu-ray media with VLC player and other compatible software. + +## Role Contents +The `main.yml` file in this role consists of tasks that automate the installation of the following packages: +1. **Install VLC and Blu-ray Software**: + - `vlc`: A versatile media player that supports Blu-ray playback. + - `libaacs`: A library for Blu-ray disc encryption handling. + - `libbluray`: A library for Blu-ray disc playback support. + +There are commented-out tasks for installing additional AUR packages, such as `aacskeys` and `libbdplus`, which can be enabled as per the user's requirements. + +## Other Resources and Resources +For more in-depth information and guidance on Blu-ray playback and software configuration, the following resources can be consulted: +- [Arch Linux Wiki on Blu-ray](https://wiki.archlinux.org/title/Blu-ray#Using_aacskeys) +- [Guide to Play Blu-ray with VLC](https://videobyte.de/play-blu-ray-with-vlc) +- [Manjaro Forum Discussion on Blu-ray UHD Playback](https://archived.forum.manjaro.org/t/wie-kann-ich-bluray-uhd-abspielen/127396/12) +- [FV Online DB](http://fvonline-db.bplaced.net/) + +## Dependencies +This role depends on the `java` role, which ensures the Java runtime is available – a requirement for certain Blu-ray playback tools and functionalities. + +## Prerequisites +- **Ansible**: Ansible must be installed on your system to use this role. +- **Arch Linux-based System**: Designed for Arch Linux distributions, using the `pacman` package manager. + +## Running the Role +To utilize this role: +1. Clone the `cymais` repository. +2. Navigate to the `roles/pc-bluray-player-tools` directory. +3. Execute the role using Ansible, with appropriate permissions for installing packages. + +## Customization +You can customize this role by enabling or adding additional tasks for other AUR packages related to Blu-ray playback as needed. + +## Support and Contributions +For support, feedback, or contributions to enhance the role's capabilities, please open an issue or submit a pull request in the `cymais` repository. Contributions that improve Blu-ray playback support or compatibility are highly appreciated. \ No newline at end of file diff --git a/roles/pc-docker/tasks/main.yml b/roles/pc-docker/tasks/main.yml index c51ba883..f6c0497c 100644 --- a/roles/pc-docker/tasks/main.yml +++ b/roles/pc-docker/tasks/main.yml @@ -6,6 +6,7 @@ state: present - name: Adding user {{client_username}} to relevant docker usergroup - user: name={{client_username}} - groups=docker - append=yes + user: + name: "{{client_username}}" + groups: docker + append: yes diff --git a/roles/pc-git/README.md b/roles/pc-git/README.md index ed5bb69a..cfed866f 100644 --- a/roles/pc-git/README.md +++ b/roles/pc-git/README.md @@ -3,29 +3,9 @@ ## Overview Welcome to the `pc-git` role documentation, part of the `cymais` repository. This role is focused on setting up Git, a widely-used version control system, on personal computers. The role includes tasks for installing Git and configuring global user details. -## Role Tasks -The `main.yml` file in the `pc-git` role consists of the following key tasks: - -1. **Set Git User Email**: Uses the `ansible.builtin.shell` module to set the global Git user email to a specified value (`{{user_email}}`). - -2. **Set Git User Name**: Similar to the above, this task sets the global Git user name (`{{user_full_name}}`) using the `ansible.builtin.shell` module. - -3. **Install Git**: Employs the `community.general.pacman` module to install the Git package, ensuring it's present on the system. - ## Purpose and Usage The `pc-git` role is essential for developers, IT professionals, and anyone who needs to utilize version control for their projects. It automates the installation of Git and the initial configuration of user identity, which is crucial for committing changes and collaborating on projects using Git. -## Prerequisites -- **Ansible**: Must be installed on your system to use this role. -- **Arch Linux-based System**: This role uses the `pacman` package manager, making it suitable for Arch Linux or similar distributions. - -## Running the Role -To use this role: -1. Clone the `cymais` repository. -2. Navigate to the `roles/pc-git` directory. -3. Make sure to define the `user_email` and `user_full_name` variables before running the role. -4. Execute the role using Ansible, ensuring you have the required permissions for software installation and configuration. - ## Customization You can customize this role by modifying the variables for user email and name or by adding additional Git configuration tasks as needed. diff --git a/roles/pc-office/README.md b/roles/pc-office/README.md index 7368ca7a..dbacc1af 100644 --- a/roles/pc-office/README.md +++ b/roles/pc-office/README.md @@ -16,7 +16,7 @@ The `main.yml` file within the `pc-office` role comprises tasks for installing a ## Dependencies This role depends on: - **pc-libreoffice**: Ensures that the LibreOffice suite, a comprehensive office package, is installed. -- **pc-video-conference**: Provides tools necessary for video conferencing, supplementing the office setup. +- **pc-zoom**: Provides tools necessary for video conferencing, supplementing the office setup. ## Purpose and Usage The `pc-office` role is ideal for users who require a full-fledged office setup on their personal computers. It encompasses tools for web browsing, email management, e-book organization, and document editing, catering to a wide range of office and productivity needs. diff --git a/roles/pc-office/meta/main.yml b/roles/pc-office/meta/main.yml index cf684c41..c9cf61a6 100644 --- a/roles/pc-office/meta/main.yml +++ b/roles/pc-office/meta/main.yml @@ -1,3 +1,3 @@ dependencies: - pc-libreoffice -- pc-video-conference \ No newline at end of file +- pc-zoom \ No newline at end of file diff --git a/roles/pc-video-conference/README.md b/roles/pc-zoom/README.md similarity index 69% rename from roles/pc-video-conference/README.md rename to roles/pc-zoom/README.md index f5658228..b1260410 100644 --- a/roles/pc-video-conference/README.md +++ b/roles/pc-zoom/README.md @@ -1,10 +1,10 @@ # PC-Video-Conference Role ## Overview -Welcome to the `pc-video-conference` role documentation, a part of the `cymais` repository. This role is focused on installing video conferencing software on Linux systems, specifically tailored for personal use and remote work requirements. +Welcome to the `pc-zoom` role documentation, a part of the `cymais` repository. This role is focused on installing video conferencing software on Linux systems, specifically tailored for personal use and remote work requirements. ## Role Tasks -The `main.yml` file in the `pc-video-conference` role includes tasks for setting up video conferencing tools: +The `main.yml` file in the `pc-zoom` role includes tasks for setting up video conferencing tools: 1. **Install Video Conference Software**: - Utilizes the `kewlfft.aur.aur` module with `yay` as the helper to install `zoom`, a popular video conferencing application. @@ -17,7 +17,7 @@ This role relies on: - **system-aur-helper**: Ensures that an Arch User Repository (AUR) helper is installed, necessary for installing software like Zoom which may not be available in standard repositories. ## Purpose and Usage -The `pc-video-conference` role is particularly useful for professionals, educators, and anyone who needs reliable video conferencing capabilities on their Linux system. With the increasing demand for remote communication, this role provides an efficient way to set up key video conferencing tools. +The `pc-zoom` role is particularly useful for professionals, educators, and anyone who needs reliable video conferencing capabilities on their Linux system. With the increasing demand for remote communication, this role provides an efficient way to set up key video conferencing tools. ## Prerequisites - **Ansible**: Required to run this role. @@ -26,7 +26,7 @@ The `pc-video-conference` role is particularly useful for professionals, educato ## Running the Role To utilize this role: 1. Clone the `cymais` repository. -2. Navigate to the `roles/pc-video-conference` directory. +2. Navigate to the `roles/pc-zoom` directory. 3. Run the role using Ansible, ensuring you have appropriate system permissions for software installation. ## Customization diff --git a/roles/pc-video-conference/meta/main.yml b/roles/pc-zoom/meta/main.yml similarity index 100% rename from roles/pc-video-conference/meta/main.yml rename to roles/pc-zoom/meta/main.yml diff --git a/roles/pc-video-conference/tasks/main.yml b/roles/pc-zoom/tasks/main.yml similarity index 100% rename from roles/pc-video-conference/tasks/main.yml rename to roles/pc-zoom/tasks/main.yml diff --git a/roles/system-aur-helper/README.md b/roles/system-aur-helper/README.md index 6405a164..b37fa45f 100644 --- a/roles/system-aur-helper/README.md +++ b/roles/system-aur-helper/README.md @@ -1,4 +1,5 @@ # System AUR Helper + ## Description This role ensures that the AUR helper [yay](https://wiki.archlinux.org/title/Yay) is installed on the system. It installs yay via [pacman](https://wiki.archlinux.org/title/Pacman) and creates a dedicated `aur_builder` user to facilitate building AUR packages. diff --git a/roles/update-pip/README.md b/roles/update-pip/README.md new file mode 100644 index 00000000..b26f2ac6 --- /dev/null +++ b/roles/update-pip/README.md @@ -0,0 +1,23 @@ +# 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 new file mode 100644 index 00000000..4dd153a1 --- /dev/null +++ b/roles/update-pip/meta/main.yml @@ -0,0 +1,26 @@ +galaxy_info: + author: "Kevin Veen-Birkenbach" + license: "CyMaIS NonCommercial License (CNCL)" + license_url: "https://s.veen.world/cncl" + 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 +dependencies: [] \ No newline at end of file diff --git a/roles/update-pip/tasks/main.yml b/roles/update-pip/tasks/main.yml new file mode 100644 index 00000000..74dc5e85 --- /dev/null +++ b/roles/update-pip/tasks/main.yml @@ -0,0 +1,4 @@ +- name: Update all local pip packages + shell: "pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U --break-system-packages" + args: + executable: /bin/bash \ No newline at end of file diff --git a/roles/update/tasks/main.yml b/roles/update/tasks/main.yml index 51a33951..10749160 100644 --- a/roles/update/tasks/main.yml +++ b/roles/update/tasks/main.yml @@ -28,4 +28,15 @@ - name: "Update with yay" include_role: name: update-yay - when: yay_installed.rc == 0 \ No newline at end of file + when: yay_installed.rc == 0 + +- name: "Check if pip is installed" + command: which pip + ignore_errors: yes + register: pip_installed + changed_when: false + +- name: "Update with pip" + include_role: + name: update-pip + when: pip_installed.rc == 0