Compare commits

...

3 Commits

105 changed files with 217 additions and 63 deletions

107
cli/meta/in_group_deps.py Normal file
View File

@@ -0,0 +1,107 @@
#!/usr/bin/env python3
"""
CLI wrapper for applications_if_group_and_deps filter.
"""
import argparse
import sys
import os
import yaml
from filter_plugins.applications_if_group_and_deps import FilterModule
def find_role_dirs_by_app_id(app_ids, roles_dir):
"""
Map application_ids to role directory names based on vars/main.yml in each role.
"""
mapping = {}
for role in os.listdir(roles_dir):
role_path = os.path.join(roles_dir, role)
vars_file = os.path.join(role_path, 'vars', 'main.yml')
if not os.path.isfile(vars_file):
continue
try:
with open(vars_file) as f:
data = yaml.safe_load(f) or {}
except Exception:
continue
app_id = data.get('application_id')
if isinstance(app_id, str) and app_id:
mapping[app_id] = role
# Translate each requested app_id to role dir if exists
dirs = []
for gid in app_ids:
if gid in mapping:
dirs.append(mapping[gid])
else:
# keep original if it matches a directory
if os.path.isdir(os.path.join(roles_dir, gid)):
dirs.append(gid)
return dirs
def main():
parser = argparse.ArgumentParser(
description="Filter applications by group names (role dirs or application_ids) and their recursive role dependencies."
)
parser.add_argument(
"-a", "--applications",
type=str,
required=True,
help="Path to YAML file defining the applications dict."
)
parser.add_argument(
"-g", "--groups",
nargs='+',
required=True,
help="List of group names to filter by (role directory names or application_ids)."
)
args = parser.parse_args()
# Load applications
try:
with open(args.applications) as f:
data = yaml.safe_load(f)
except Exception as e:
print(f"Error loading applications file: {e}", file=sys.stderr)
sys.exit(1)
# Unwrap under 'applications' key if present
if isinstance(data, dict) and 'applications' in data and isinstance(data['applications'], dict):
applications = data['applications']
else:
applications = data
if not isinstance(applications, dict):
print(
f"Expected applications YAML to contain a mapping (or 'applications' mapping), got {type(applications).__name__}",
file=sys.stderr
)
sys.exit(1)
# Determine roles_dir relative to project root
script_dir = os.path.dirname(__file__)
project_root = os.path.abspath(os.path.join(script_dir, '..', '..', '..'))
roles_dir = os.path.join(project_root, 'roles')
# Map user-provided groups (which may be application_ids) to role directory names
group_dirs = find_role_dirs_by_app_id(args.groups, roles_dir)
if not group_dirs:
print(f"No matching role directories found for groups: {args.groups}", file=sys.stderr)
sys.exit(1)
# Run filter using role directory names
try:
filtered = FilterModule().applications_if_group_and_deps(
applications,
group_dirs
)
except Exception as e:
print(f"Error running filter: {e}", file=sys.stderr)
sys.exit(1)
# Output result as YAML
print(yaml.safe_dump(filtered, default_flow_style=False))
if __name__ == '__main__':
main()

View File

@@ -14,8 +14,8 @@ For a complete list of role categories and detailed definitions, see:
- **core-*** - **core-***
Fundamental system configuration (SSH, journald, sudo, etc.) Fundamental system configuration (SSH, journald, sudo, etc.)
- **gen-*** - **dev-***
Generic helpers and language/tool installers (e.g. `gen-git`, `gen-locales`, `sys-timer`) Generic helpers and language/tool installers (e.g. `dev-git`, `dev-locales`, `sys-timer`)
- **desk-*** - **desk-***
Desktop environment and application roles (e.g. `desk-gnome`, `desk-browser`, `desk-libreoffice`) Desktop environment and application roles (e.g. `desk-gnome`, `desk-browser`, `desk-libreoffice`)
@@ -111,7 +111,7 @@ For a complete list of role categories and detailed definitions, see:
--- ---
> **Tip:** To find a role quickly, search for its prefix: > **Tip:** To find a role quickly, search for its prefix:
> `core-`, `gen-`, `desk-`, `srv-web-`, `web-svc-`, `web-app-`, > `core-`, `dev-`, `desk-`, `srv-web-`, `web-svc-`, `web-app-`,
> `net-`, `svc-`, `sys-hlth-`, `monitor-core-`, `sys-alm-`, > `net-`, `svc-`, `sys-hlth-`, `monitor-core-`, `sys-alm-`,
> `maint-`, `maint-docker-`, `sys-cln-`, `sys-bkp-`, `update-`, > `maint-`, `maint-docker-`, `sys-cln-`, `sys-bkp-`, `update-`,
> `pkgmgr-`, `user-`. > `pkgmgr-`, `user-`.

View File

@@ -1,4 +1,7 @@
roles: roles:
dev:
title: "Software Development Utilties"
invokable: false
sys: sys:
title: "System" title: "System"
invokable: false invokable: false

View File

@@ -20,5 +20,5 @@ galaxy_info:
- name: Archlinux - name: Archlinux
versions: [ all ] versions: [ all ]
dependencies: dependencies:
- gen-java - dev-java

View File

@@ -14,4 +14,4 @@ galaxy_info:
- autostart - autostart
- archlinux - archlinux
dependencies: dependencies:
- gen-aur-helper - sys-pgm-aur

View File

@@ -11,7 +11,7 @@ The `main.yml` file in the `desk-qbittorrent` role includes the following task:
## Dependencies ## Dependencies
This role depends on: This role depends on:
- **gen-aur-helper**: Ensures that an Arch User Repository (AUR) helper is installed, which is necessary for installing packages like `qbittorrent` that are not available in the standard repositories. - **sys-pgm-aur**: Ensures that an Arch User Repository (AUR) helper is installed, which is necessary for installing packages like `qbittorrent` that are not available in the standard repositories.
## Purpose and Usage ## Purpose and Usage
The `desk-qbittorrent` role is tailored for users who require a reliable and user-friendly torrent client for downloading and sharing files via the BitTorrent protocol. qBittorrent is known for its balance of features, simplicity, and minimal impact on system resources. The `desk-qbittorrent` role is tailored for users who require a reliable and user-friendly torrent client for downloading and sharing files via the BitTorrent protocol. qBittorrent is known for its balance of features, simplicity, and minimal impact on system resources.

View File

@@ -19,5 +19,5 @@ galaxy_info:
- name: Archlinux - name: Archlinux
versions: [ all ] versions: [ all ]
dependencies: dependencies:
- gen-aur-helper - sys-pgm-aur

View File

@@ -16,18 +16,18 @@ To automate the installation of Spotify on Arch-based systems while ensuring pro
- 🎧 Installs the official [Spotify AUR package](https://aur.archlinux.org/packages/spotify) - 🎧 Installs the official [Spotify AUR package](https://aur.archlinux.org/packages/spotify)
- 🛠 Uses `yay` (or other helper) via [`kewlfft.aur`](https://github.com/kewlfft/ansible-aur) Ansible module - 🛠 Uses `yay` (or other helper) via [`kewlfft.aur`](https://github.com/kewlfft/ansible-aur) Ansible module
- 🔗 Declares dependency on `gen-aur-helper` for seamless integration - 🔗 Declares dependency on `sys-pgm-aur` for seamless integration
## Requirements ## Requirements
- The `gen-aur-helper` role must be applied before using this role. - The `sys-pgm-aur` role must be applied before using this role.
- An AUR helper like `yay` must be available on the system. - An AUR helper like `yay` must be available on the system.
## Dependencies ## Dependencies
This role depends on: This role depends on:
- [`gen-aur-helper`](../gen-aur-helper) provides and configures an AUR helper like `yay` - [`sys-pgm-aur`](../sys-pgm-aur) provides and configures an AUR helper like `yay`
## Credits 📝 ## Credits 📝

View File

@@ -24,4 +24,4 @@ galaxy_info:
issue_tracker_url: https://s.veen.world/cymaisissues issue_tracker_url: https://s.veen.world/cymaisissues
documentation: https://s.veen.world/cymais documentation: https://s.veen.world/cymais
dependencies: dependencies:
- gen-aur-helper - sys-pgm-aur

View File

@@ -27,4 +27,4 @@ galaxy_info:
dependencies: dependencies:
- desk-git - desk-git
- gen-shell - dev-shell

View File

@@ -14,7 +14,7 @@ The `main.yml` file in the `desk-zoom` role includes tasks for setting up video
## Dependencies ## Dependencies
This role relies on: This role relies on:
- **gen-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. - **sys-pgm-aur**: 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 ## Purpose and Usage
The `desk-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. The `desk-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.

View File

@@ -20,5 +20,5 @@ galaxy_info:
- name: Archlinux - name: Archlinux
versions: [ all ] versions: [ all ]
dependencies: dependencies:
- gen-aur-helper - sys-pgm-aur

View File

@@ -14,7 +14,7 @@ galaxy_info:
- openjdk - openjdk
repository: "https://github.com/kevinveenbirkenbach/cymais" repository: "https://github.com/kevinveenbirkenbach/cymais"
issue_tracker_url: "https://github.com/kevinveenbirkenbach/cymais/issues" issue_tracker_url: "https://github.com/kevinveenbirkenbach/cymais/issues"
documentation: "https://github.com/kevinveenbirkenbach/cymais/tree/main/roles/gen-java" documentation: "https://github.com/kevinveenbirkenbach/cymais/tree/main/roles/dev-java"
min_ansible_version: "2.9" min_ansible_version: "2.9"
platforms: platforms:
- name: Archlinux - name: Archlinux

View File

@@ -13,6 +13,6 @@ galaxy_info:
- locales - locales
repository: "https://github.com/kevinveenbirkenbach/cymais" repository: "https://github.com/kevinveenbirkenbach/cymais"
issue_tracker_url: "https://github.com/kevinveenbirkenbach/cymais/issues" issue_tracker_url: "https://github.com/kevinveenbirkenbach/cymais/issues"
documentation: "https://github.com/kevinveenbirkenbach/cymais/roles/gen-locales" documentation: "https://github.com/kevinveenbirkenbach/cymais/roles/dev-locales"
run_after: [] run_after: []
dependencies: [] dependencies: []

View File

@@ -23,4 +23,4 @@ galaxy_info:
issue_tracker_url: "https://s.veen.world/cymaisissues" issue_tracker_url: "https://s.veen.world/cymaisissues"
documentation: "https://s.veen.world/cymais" documentation: "https://s.veen.world/cymais"
dependencies: dependencies:
- gen-gcc - dev-gcc

View File

@@ -20,5 +20,5 @@ galaxy_info:
- name: Archlinux - name: Archlinux
versions: [ all ] versions: [ all ]
dependencies: dependencies:
- gen-aur-helper - sys-pgm-aur

View File

@@ -20,7 +20,7 @@ The `vendor_and_product_id` variable is required and should be set to the vendor
## Dependencies ## Dependencies
- `gen-aur-helper` - `sys-pgm-aur`
## Example Playbook ## Example Playbook

View File

@@ -8,5 +8,5 @@ galaxy_info:
versions: versions:
- all - all
dependencies: dependencies:
- gen-aur-helper - sys-pgm-aur
- sys-alm-compose - sys-alm-compose

View File

@@ -1 +0,0 @@
application_id: aur-helper

View File

@@ -1 +0,0 @@
application_id: fakeroot

View File

@@ -1 +0,0 @@
application_id: gcc

View File

@@ -1 +0,0 @@
application_id: git

View File

@@ -1 +0,0 @@
application_id: hostname

View File

@@ -1 +0,0 @@
application_id: npm

View File

@@ -1 +0,0 @@
application_id: postfix

View File

@@ -1 +0,0 @@
application_id: python-pip

View File

@@ -1 +0,0 @@
application_id: python-yaml

View File

@@ -1 +0,0 @@
application_id: shell

View File

@@ -13,7 +13,6 @@ galaxy_info:
versions: versions:
- rolling - rolling
galaxy_tags: galaxy_tags:
- pkgmgr
- package - package
- update - update
- archlinux - archlinux

View File

@@ -33,6 +33,6 @@ galaxy_info:
issue_tracker_url: https://github.com/kevinveenbirkenbach/package-manager/issues issue_tracker_url: https://github.com/kevinveenbirkenbach/package-manager/issues
documentation: https://github.com/kevinveenbirkenbach/package-manager documentation: https://github.com/kevinveenbirkenbach/package-manager
dependencies: dependencies:
- gen-git - dev-git
- gen-make - dev-make
- gen-python-yaml - dev-python-yaml

View File

@@ -1 +0,0 @@
application_id: certbot

View File

@@ -25,7 +25,7 @@ galaxy_info:
issue_tracker_url: "https://s.veen.world/cymaisissues" issue_tracker_url: "https://s.veen.world/cymaisissues"
documentation: "https://s.veen.world/cymais" documentation: "https://s.veen.world/cymais"
dependencies: dependencies:
- gen-git - dev-git
- sys-alm-compose - sys-alm-compose
- sys-cln-bkps-timer - sys-cln-bkps-timer
- sys-cln-faild-bkps - sys-cln-faild-bkps

View File

@@ -22,7 +22,7 @@ galaxy_info:
issue_tracker_url: "https://s.veen.world/cymaisissues" issue_tracker_url: "https://s.veen.world/cymaisissues"
documentation: "https://s.veen.world/cymais" documentation: "https://s.veen.world/cymais"
dependencies: dependencies:
- gen-python-pip - dev-python-pip
- sys-alm-compose - sys-alm-compose
- sys-lock - sys-lock
- sys-rst-daemon - sys-rst-daemon

View File

@@ -22,5 +22,5 @@ galaxy_info:
repository: "https://s.veen.world/cymais" repository: "https://s.veen.world/cymais"
documentation: "https://s.veen.world/cymais" documentation: "https://s.veen.world/cymais"
dependencies: dependencies:
- gen-python-pip - dev-python-pip
- sys-alm-compose - sys-alm-compose

View File

@@ -13,6 +13,6 @@ galaxy_info:
- hostname - hostname
repository: "https://github.com/kevinveenbirkenbach/cymais" repository: "https://github.com/kevinveenbirkenbach/cymais"
issue_tracker_url: "https://github.com/kevinveenbirkenbach/cymais/issues" issue_tracker_url: "https://github.com/kevinveenbirkenbach/cymais/issues"
documentation: "https://github.com/kevinveenbirkenbach/cymais/roles/gen-hostname" documentation: "https://github.com/kevinveenbirkenbach/cymais/roles/sys-hostname"
run_after: [] run_after: []
dependencies: [] dependencies: []

View File

@@ -22,4 +22,4 @@ galaxy_info:
issue_tracker_url: "https://s.veen.world/cymaisissues" issue_tracker_url: "https://s.veen.world/cymaisissues"
documentation: "https://s.veen.world/cymais" documentation: "https://s.veen.world/cymais"
dependencies: dependencies:
- gen-fakeroot - dev-fakeroot

View File

@@ -24,4 +24,4 @@ galaxy_info:
- update - update
- maintenance - maintenance
dependencies: dependencies:
- gen-python-pip - dev-python-pip

View File

@@ -24,4 +24,4 @@ galaxy_info:
issue_tracker_url: "https://s.veen.world/cymaisissues" issue_tracker_url: "https://s.veen.world/cymaisissues"
documentation: "https://s.veen.world/cymais" documentation: "https://s.veen.world/cymais"
dependencies: dependencies:
- gen-aur-helper - sys-pgm-aur

View File

@@ -21,5 +21,5 @@ galaxy_info:
- name: Archlinux - name: Archlinux
versions: [ all ] versions: [ all ]
dependencies: dependencies:
- gen-aur-helper - sys-pgm-aur

View File

@@ -18,7 +18,7 @@ To reduce setup time and ensure consistency across developer workstations, this
- **Installs Visual Studio Code:** A powerful code editor with a wide plugin ecosystem. - **Installs Visual Studio Code:** A powerful code editor with a wide plugin ecosystem.
- **Extensible Design:** Acts as a base layer for more specific development stacks (e.g., web, Python, embedded). - **Extensible Design:** Acts as a base layer for more specific development stacks (e.g., web, Python, embedded).
- **Persona Integration:** Extends the `util-gen-admin` for technical users with a development focus. - **Persona Integration:** Extends the `util-dev-admin` for technical users with a development focus.
## Credits 📝 ## Credits 📝

View File

@@ -24,5 +24,5 @@ galaxy_info:
issue_tracker_url: https://s.veen.world/cymaisissues issue_tracker_url: https://s.veen.world/cymaisissues
documentation: https://s.veen.world/cymais documentation: https://s.veen.world/cymais
dependencies: dependencies:
- util-gen-admin - util-dev-admin
- pkgmgr - pkgmgr

View File

@@ -25,5 +25,5 @@ galaxy_info:
issue_tracker_url: https://s.veen.world/cymaisissues issue_tracker_url: https://s.veen.world/cymaisissues
documentation: https://s.veen.world/cymais documentation: https://s.veen.world/cymais
dependencies: dependencies:
- gen-java - dev-java
- util-desk-dev-core - util-desk-dev-core

View File

@@ -26,4 +26,4 @@ galaxy_info:
documentation: https://s.veen.world/cymais documentation: https://s.veen.world/cymais
dependencies: dependencies:
- util-desk-dev-core - util-desk-dev-core
- gen-python-pip - dev-python-pip

View File

@@ -8,7 +8,7 @@ Learn more about Linux network tools on the [Arch Wiki - Network Tools](https://
## Overview ## Overview
This role enhances the base `util-gen-admin` role by adding tools specifically for analyzing, debugging, and monitoring network traffic and connectivity. This role enhances the base `util-dev-admin` role by adding tools specifically for analyzing, debugging, and monitoring network traffic and connectivity.
## Purpose ## Purpose

View File

@@ -23,4 +23,4 @@ galaxy_info:
issue_tracker_url: https://s.veen.world/cymaisissues issue_tracker_url: https://s.veen.world/cymaisissues
documentation: https://s.veen.world/cymais documentation: https://s.veen.world/cymais
dependencies: dependencies:
- util-gen-admin - util-dev-admin

View File

@@ -0,0 +1 @@
application_id: dev-admin-network

View File

@@ -24,5 +24,5 @@ galaxy_info:
documentation: https://s.veen.world/cymais documentation: https://s.veen.world/cymais
dependencies: dependencies:
- desk-git - desk-git
- gen-make - dev-make
- gen-gcc - dev-gcc

View File

@@ -0,0 +1 @@
application_id: dev-admin

View File

@@ -1 +0,0 @@
application_id: gen-admin-network

View File

@@ -1 +0,0 @@
application_id: gen-admin

View File

@@ -1,6 +1,6 @@
# vars/oidc.yml # vars/oidc.yml
# Defines OIDC settings for the OpenID Connect Generic plugin, with explanatory comments. # Defines OIDC settings for the OpenID Connect Generic plugin, with explanatory comments.
# @see https://github.com/oidc-wp/openid-connect-generic/blob/develop/includes/openid-connect-gen-option-settings.php # @see https://github.com/oidc-wp/openid-connect-generic/blob/develop/includes/openid-connect-dev-option-settings.php
oidc_settings: oidc_settings:
client_id: "{{ oidc.client.id }}" # The client ID that identifies WordPress as the OIDC client. client_id: "{{ oidc.client.id }}" # The client ID that identifies WordPress as the OIDC client.

Some files were not shown because too many files have changed in this diff Show More