mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Optimized portfolio and pkgmgr update procedures
This commit is contained in:
@@ -73,6 +73,11 @@ class LookupModule(LookupBase):
|
||||
meta_data = yaml.safe_load(f)
|
||||
|
||||
galaxy_info = meta_data.get("galaxy_info", {})
|
||||
|
||||
# If display is set to False ignore it
|
||||
if not galaxy_info.get("display", True):
|
||||
continue
|
||||
|
||||
description = galaxy_info.get("description", "")
|
||||
logo = galaxy_info.get("logo", {})
|
||||
icon_class = logo.get("class", "fa-solid fa-cube")
|
||||
|
@@ -0,0 +1,38 @@
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
from ansible.plugins.lookup import LookupBase
|
||||
from ansible.errors import AnsibleError
|
||||
|
||||
class LookupModule(LookupBase):
|
||||
def run(self, terms, variables=None, **kwargs):
|
||||
"""
|
||||
Group the given cards into categorized and uncategorized lists
|
||||
based on the tags from menu_categories.
|
||||
"""
|
||||
if len(terms) < 1:
|
||||
raise AnsibleError("Missing required argument: cards")
|
||||
|
||||
cards = terms[0]
|
||||
menu_categories = variables.get("menu_categories", {})
|
||||
|
||||
categorized = {}
|
||||
uncategorized = []
|
||||
|
||||
for card in cards:
|
||||
found = False
|
||||
for category, data in menu_categories.items():
|
||||
if any(tag in data.get('tags', []) for tag in card.get('tags', [])):
|
||||
categorized.setdefault(category, []).append(card)
|
||||
found = True
|
||||
break
|
||||
if not found:
|
||||
uncategorized.append(card)
|
||||
|
||||
return [
|
||||
{
|
||||
'categorized': categorized,
|
||||
'uncategorized': uncategorized,
|
||||
}
|
||||
]
|
||||
|
@@ -21,6 +21,22 @@
|
||||
become: false
|
||||
register: config_file
|
||||
|
||||
- name: Load docker cards
|
||||
set_fact:
|
||||
portfolio_cards: "{{ lookup('docker_cards', 'roles') }}"
|
||||
|
||||
- name: Group docker cards
|
||||
set_fact:
|
||||
portfolio_menu_data: "{{ lookup('docker_cards_grouped', portfolio_cards) }}"
|
||||
|
||||
- name: Debug portfolio data
|
||||
debug:
|
||||
msg:
|
||||
cards: "{{ portfolio_cards }}"
|
||||
menu_data: "{{ portfolio_menu_data }}"
|
||||
when: enable_debug | bool
|
||||
|
||||
|
||||
- name: Copy host-specific config.yaml if it exists
|
||||
template:
|
||||
src: "{{ config_inventory_path }}"
|
||||
|
@@ -105,7 +105,7 @@ accounts:
|
||||
- link: navigation.header.contact
|
||||
|
||||
cards:
|
||||
{{ lookup('docker_cards', 'roles') | to_nice_yaml(indent=2) }}
|
||||
{{ portfolio_cards | to_nice_yaml(indent=2) }}
|
||||
|
||||
platform:
|
||||
titel: {{service_provider.platform.titel}}
|
||||
@@ -166,249 +166,14 @@ navigation:
|
||||
footer:
|
||||
children:
|
||||
- link: accounts
|
||||
|
||||
{% if ["discourse","moodle","listmonk","openproject","taiga","snipe_it","matrix","bigbluebutton","mailu", "matomo","phpmyadmin","keycloak", "ldap", "baserow","yourls","nextcloud"] | any_in(group_names) %}
|
||||
|
||||
- name: Solution Hub
|
||||
description: Curated collection of self hosted tools
|
||||
icon:
|
||||
class: fa-solid fa-network-wired
|
||||
children:
|
||||
|
||||
{% if ["discourse","moodle","listmonk"] | any_in(group_names) %}
|
||||
|
||||
- name: Community
|
||||
description: Tools to manage the community
|
||||
icon:
|
||||
class: fa-solid fa-users
|
||||
children:
|
||||
|
||||
{% if "discourse" in group_names %}
|
||||
|
||||
- name: Forum
|
||||
description: Join the discussion
|
||||
icon:
|
||||
class: fa-brands fa-discourse
|
||||
url: https://{{domains.discourse}}/
|
||||
iframe: {{ applications | get_landingpage_iframe_enabled('discourse') }}
|
||||
|
||||
{% endif %}
|
||||
{% if "moodle" in group_names %}
|
||||
|
||||
- name: Learning Platform
|
||||
description: Learn with {{ 'our' if service_provider.type == 'legal' else 'my' }} academy
|
||||
icon:
|
||||
class: fa-solid fa-graduation-cap
|
||||
url: https://{{domains.moodle}}/
|
||||
iframe: {{ applications | get_landingpage_iframe_enabled('moodle') }}
|
||||
|
||||
{% endif %}
|
||||
{% if "listmonk" in group_names %}
|
||||
|
||||
- name: Newsletter
|
||||
description: Subscribe to {{ 'our' if service_provider.type == 'legal' else 'my' }} newsletter
|
||||
icon:
|
||||
class: fa-solid fa-envelope-open-text
|
||||
url: https://{{domains.listmonk}}/subscription/form
|
||||
iframe: {{ applications | get_landingpage_iframe_enabled('listmonk') }}
|
||||
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if ["openproject","taiga","snipe_it"] | any_in(group_names) %}
|
||||
|
||||
- name: Project Management
|
||||
description: Project Management Tools
|
||||
icon:
|
||||
class: fa-solid fa-chart-line
|
||||
children:
|
||||
|
||||
{% if "openproject" in group_names %}
|
||||
|
||||
- name: Open Project
|
||||
description: Explore {{ 'our' if service_provider.type == 'legal' else 'my' }} projects
|
||||
icon:
|
||||
class: fa-solid fa-tasks
|
||||
url: https://{{domains.openproject}}/
|
||||
iframe: {{ applications | get_landingpage_iframe_enabled('openproject') }}
|
||||
|
||||
{% endif %}
|
||||
{% if "taiga" in group_names %}
|
||||
|
||||
- name: Taiga
|
||||
description: View {{ 'our' if service_provider.type == 'legal' else 'my' }} Kanban board
|
||||
icon:
|
||||
class: bi bi-clipboard2-check-fill
|
||||
url: https://{{domains.taiga}}/
|
||||
iframe: {{ applications | get_landingpage_iframe_enabled('taiga') }}
|
||||
|
||||
{% endif %}
|
||||
{% if "snipe_it" in group_names %}
|
||||
|
||||
- name: Snipe IT
|
||||
description: Manage {{ 'our' if service_provider.type == 'legal' else 'my' }} inventory
|
||||
icon:
|
||||
class: fas fa-box-open
|
||||
url: https://{{domains.snipe_it}}/
|
||||
iframe: {{ applications | get_landingpage_iframe_enabled('snipe_it') }}
|
||||
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if ["matrix","bigbluebutton","mailu"] | any_in(group_names) %}
|
||||
|
||||
- name: Communication
|
||||
icon:
|
||||
class: fa-solid fa-comments
|
||||
children:
|
||||
|
||||
{% if "matrix" in group_names %}
|
||||
|
||||
- name: Elements
|
||||
description: Chat with the world
|
||||
icon:
|
||||
class: fa-solid fa-comment
|
||||
url: https://{{domains.matrix_element}}/
|
||||
iframe: {{ applications | get_landingpage_iframe_enabled('matrix') }}
|
||||
|
||||
{% endif %}
|
||||
{% if "bigbluebutton" in group_names %}
|
||||
|
||||
- name: Big Blue Button
|
||||
description: Join live events
|
||||
icon:
|
||||
class: fa-solid fa-video
|
||||
url: https://{{domains.bigbluebutton}}/
|
||||
iframe: {{ applications | get_landingpage_iframe_enabled('bigbluebutton') }}
|
||||
|
||||
{% endif %}
|
||||
{% if "mailu" in group_names %}
|
||||
|
||||
- name: Mailu
|
||||
description: Send{{ 'our' if service_provider.type == 'legal' else 'my' }}a mail
|
||||
icon:
|
||||
class: fa-solid fa-envelope
|
||||
url: https://{{domains.mailu}}/
|
||||
iframe: {{ applications | get_landingpage_iframe_enabled('mailu') }}
|
||||
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if ["matomo","phpmyadmin","keycloak", "ldap"] | any_in(group_names) %}
|
||||
|
||||
- name: Administration
|
||||
icon:
|
||||
class: fas fa-building
|
||||
children:
|
||||
|
||||
{% if "matomo" in group_names %}
|
||||
|
||||
- name: Matomo
|
||||
description: Analyze with Matomo
|
||||
icon:
|
||||
class: fa-solid fa-chart-simple
|
||||
url: https://{{domains.matomo}}/
|
||||
iframe: {{ applications | get_landingpage_iframe_enabled('matomo') }}
|
||||
|
||||
{% endif %}
|
||||
{% if "phpmyadmin" in group_names %}
|
||||
|
||||
- name: phpMyAdmin
|
||||
description: Administrate MySQL and MariaDB databases
|
||||
icon:
|
||||
class: fas fa-database
|
||||
url: https://{{domains.phpmyadmin}}/
|
||||
iframe: {{ applications | get_landingpage_iframe_enabled('phpmyadmin') }}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% if "pgadmin" in group_names %}
|
||||
|
||||
- name: pgAdmin
|
||||
description: Administrate PostgreSQL databases with ease and precision
|
||||
icon:
|
||||
class: fas fa-database
|
||||
url: https://{{domains.pgadmin}}/
|
||||
iframe: {{ applications | get_landingpage_iframe_enabled('pgadmin') }}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% if "keycloak" in group_names %}
|
||||
|
||||
- name: Keycloak
|
||||
description: Manage User via Keycloak
|
||||
icon:
|
||||
class: fas fa-user-shield
|
||||
iframe: {{ applications | get_landingpage_iframe_enabled('keycloak') }}
|
||||
children:
|
||||
- name: Administration
|
||||
description: Access the central admin console
|
||||
icon:
|
||||
class: fa-solid fa-shield-halved
|
||||
url: https://{{domains.keycloak}}/admin
|
||||
iframe: {{ applications | get_landingpage_iframe_enabled('keycloak') }}
|
||||
- name: Profile
|
||||
description: Update your personal admin settings
|
||||
icon:
|
||||
class: fa-solid fa-user-gear
|
||||
url: https://{{ domains.keycloak }}/realms/{{oidc.client.id}}/account
|
||||
iframe: {{ applications | get_landingpage_iframe_enabled('keycloak') }}
|
||||
- name: Logout
|
||||
description: End your admin session securely
|
||||
icon:
|
||||
class: fa-solid fa-right-from-bracket
|
||||
url: https://{{ domains.keycloak }}/realms/{{oidc.client.id}}/protocol/openid-connect/logout
|
||||
iframe: false
|
||||
|
||||
{% endif %}
|
||||
{% if "ldap" in group_names %}
|
||||
|
||||
- name: LDAP
|
||||
description: Manage LDAP
|
||||
icon:
|
||||
class: fas fa-key
|
||||
url: https://{{domains.ldap}}/
|
||||
iframe: {{ applications | get_landingpage_iframe_enabled('ldap') }}
|
||||
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if ["baserow","yourls","nextcloud"] | any_in(group_names) %}
|
||||
|
||||
- name: Tools
|
||||
icon:
|
||||
class: fas fa-tools
|
||||
children:
|
||||
|
||||
{% if "baserow" in group_names %}
|
||||
|
||||
- name: Baserow
|
||||
description: Organize with Baserow
|
||||
icon:
|
||||
class: fa-solid fa-table
|
||||
url: https://{{domains.baserow}}/
|
||||
iframe: {{ applications | get_landingpage_iframe_enabled('baserow') }}
|
||||
|
||||
{% endif %}
|
||||
{% if "yourls" in group_names %}
|
||||
|
||||
- name: Yourls
|
||||
description: Create Shortlinks
|
||||
icon:
|
||||
class: bi bi-link
|
||||
url: https://{{domains.yourls}}/admin/
|
||||
iframe: {{ applications | get_landingpage_iframe_enabled('yourls') }}
|
||||
|
||||
{% endif %}
|
||||
{% if "nextcloud" in group_names %}
|
||||
|
||||
- name: Nextcloud
|
||||
description: Access your cloud storage
|
||||
icon:
|
||||
class: fa-solid fa-cloud
|
||||
url: https://{{domains.nextcloud}}/
|
||||
iframe: {{ applications | get_landingpage_iframe_enabled('nextcloud') }}
|
||||
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% include 'footer_menu.yaml.j2' %}
|
||||
|
||||
- name: Support Us
|
||||
description: "Discover all the ways you can support our work."
|
||||
icon:
|
||||
@@ -444,6 +209,17 @@ navigation:
|
||||
url: https://{{domains.sphinx}}
|
||||
iframe: {{ applications | get_landingpage_iframe_enabled('sphinx') }}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% if "presentation" in group_names %}
|
||||
|
||||
- name: Slides
|
||||
description: Access our comprehensive documentation and support resources to help you get the most out of the software.
|
||||
icon:
|
||||
class: fas fa-book
|
||||
url: https://{{domains.sphinx}}
|
||||
iframe: {{ applications | get_landingpage_iframe_enabled('sphinx') }}
|
||||
|
||||
{% endif %}
|
||||
|
||||
- name: Imprint
|
||||
|
52
roles/docker-portfolio/templates/footer_menu.yaml.j2
Normal file
52
roles/docker-portfolio/templates/footer_menu.yaml.j2
Normal file
@@ -0,0 +1,52 @@
|
||||
{# Render all categories #}
|
||||
{% for category, apps in portfolio_menu_data.categorized %}
|
||||
- name: {{ category }}
|
||||
description: {{ category_data.menu_categories[category].description }}
|
||||
icon:
|
||||
class: {{ category_data.menu_categories[category].icon }}
|
||||
children:
|
||||
{% for app in apps %}
|
||||
- name: {{ app.title }}
|
||||
description: {{ app.text }}
|
||||
icon: {{ app.icon }}
|
||||
url: {{ app.url }}
|
||||
iframe: {{ app.iframe }}
|
||||
{% if app.title == 'Keycloak' %}
|
||||
children:
|
||||
- name: Administration
|
||||
description: Access the central admin console
|
||||
icon:
|
||||
class: fa-solid fa-shield-halved
|
||||
url: https://{{domains.keycloak}}/admin
|
||||
iframe: {{ applications | get_landingpage_iframe_enabled('keycloak') }}
|
||||
- name: Profile
|
||||
description: Update your personal admin settings
|
||||
icon:
|
||||
class: fa-solid fa-user-gear
|
||||
url: https://{{ domains.keycloak }}/realms/{{oidc.client.id}}/account
|
||||
iframe: {{ applications | get_landingpage_iframe_enabled('keycloak') }}
|
||||
- name: Logout
|
||||
description: End your admin session securely
|
||||
icon:
|
||||
class: fa-solid fa-right-from-bracket
|
||||
url: https://{{ domains.keycloak }}/realms/{{oidc.client.id}}/protocol/openid-connect/logout
|
||||
iframe: false
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
|
||||
{# Render Uncategorized
|
||||
{% if portfolio_menu_data.uncategorized %}
|
||||
- name: Uncategorized
|
||||
description: Tools without a defined category
|
||||
icon:
|
||||
class: fa-solid fa-question
|
||||
children:
|
||||
{% for app in portfolio_menu_data.uncategorized %}
|
||||
- name: {{ app.title }}
|
||||
description: {{ app.text }}
|
||||
icon: {{ app.icon }}
|
||||
url: {{ app.url }}
|
||||
iframe: {{ app.iframe }}
|
||||
{% endfor %}
|
||||
{% endif %} #}
|
42
roles/docker-portfolio/vars/menu_categories.yml
Normal file
42
roles/docker-portfolio/vars/menu_categories.yml
Normal file
@@ -0,0 +1,42 @@
|
||||
menu_categories:
|
||||
Community:
|
||||
description: Tools to manage the community
|
||||
icon: fa-solid fa-users
|
||||
tags:
|
||||
- community
|
||||
- forum
|
||||
- learning
|
||||
- newsletter
|
||||
|
||||
Project Management:
|
||||
description: Project Management Tools
|
||||
icon: fa-solid fa-chart-line
|
||||
tags:
|
||||
- project
|
||||
- kanban
|
||||
- management
|
||||
|
||||
Communication:
|
||||
description: Tools for communication
|
||||
icon: fa-solid fa-comments
|
||||
tags:
|
||||
- chat
|
||||
- communication
|
||||
- video
|
||||
- mail
|
||||
|
||||
Administration:
|
||||
description: Administration Tools
|
||||
icon: fas fa-building
|
||||
tags:
|
||||
- administration
|
||||
- database
|
||||
- user-management
|
||||
|
||||
Tools:
|
||||
description: Helpful Tools
|
||||
icon: fas fa-tools
|
||||
tags:
|
||||
- tools
|
||||
- utility
|
||||
- baserow
|
Reference in New Issue
Block a user