mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-30 07:18:09 +02:00
Different optimations and mig integration. test will fail due to strickter validation checks. need to be cleaned up tomorrow
This commit is contained in:
21
roles/web-app-mig/README.md
Normal file
21
roles/web-app-mig/README.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# MIG
|
||||
|
||||
This folder contains the Ansible role to deploy the Meta Infinite Graph for CyMaIS.
|
||||
|
||||
## Description
|
||||
|
||||
This role sets up the [Ansible Meta Infinite Graph](https://github.com/kevinveenbirkenbach/meta-infinite-graph) for CyMaIS. The Meta Infinite Graph visualizes all dependencies and relationships between CyMaIS roles, making the overall infrastructure structure transparent and easy to understand.
|
||||
|
||||
## Overview
|
||||
|
||||
The Meta Infinite Graph is an essential tool for analyzing, auditing, and maintaining the modular structure of the CyMaIS ecosystem. It provides a clear overview of all roles and how they are interconnected.
|
||||
|
||||
## Features
|
||||
|
||||
- Automatic deployment of the Meta Infinite Graph web application
|
||||
- Shows all dependencies and connections between CyMaIS roles
|
||||
- Useful for documentation and architecture transparency
|
||||
|
||||
## Further Resources
|
||||
|
||||
- [Meta Infinite Graph Homepage](https://github.com/kevinveenbirkenbach/meta-infinite-graph)
|
2
roles/web-app-mig/TODO.md
Normal file
2
roles/web-app-mig/TODO.md
Normal file
@@ -0,0 +1,2 @@
|
||||
# Todos
|
||||
- Use svc-meta-creator to speed up deployment
|
37
roles/web-app-mig/config/main.yml
Normal file
37
roles/web-app-mig/config/main.yml
Normal file
@@ -0,0 +1,37 @@
|
||||
docker:
|
||||
services:
|
||||
redis:
|
||||
enabled: false # No redis needed
|
||||
database:
|
||||
enabled: false # No database needed
|
||||
features:
|
||||
matomo: true # activate tracking
|
||||
css: true # use custom cymais stile
|
||||
port-ui-desktop: true # Enable in port-ui
|
||||
csp:
|
||||
whitelist:
|
||||
script-src-elem:
|
||||
- https://cdn.jsdelivr.net
|
||||
- https://kit.fontawesome.com
|
||||
- https://code.jquery.com/
|
||||
- https://unpkg.com/
|
||||
style-src:
|
||||
- https://cdn.jsdelivr.net
|
||||
- https://cdnjs.cloudflare.com
|
||||
font-src:
|
||||
- https://cdnjs.cloudflare.com
|
||||
- https://ka-f.fontawesome.com
|
||||
- https://cdn.jsdelivr.net
|
||||
connect-src:
|
||||
- https://ka-f.fontawesome.com
|
||||
#frame-src:
|
||||
# - "{{ web_protocol }}://*.{{primary_domain}}"
|
||||
flags:
|
||||
style-src:
|
||||
unsafe-inline: true
|
||||
domains:
|
||||
canonical:
|
||||
- "mig.{{ primary_domain }}"
|
||||
aliases:
|
||||
- "meta-infinite-graph.{{ primary_domain }}"
|
||||
build_data: true # Enables the building of the meta data which the graph requiers
|
25
roles/web-app-mig/meta/main.yml
Normal file
25
roles/web-app-mig/meta/main.yml
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
galaxy_info:
|
||||
author: "Kevin Veen-Birkenbach"
|
||||
description: >
|
||||
The Meta Infinite Graph offers you an interactive, visual map of all CyMaIS roles and their dependencies—making it easy to explore, understand, and navigate the complete structure of your infrastructure.
|
||||
license: "CyMaIS NonCommercial License (CNCL)"
|
||||
license_url: "https://s.veen.world/cncl"
|
||||
company: |
|
||||
Kevin Veen-Birkenbach
|
||||
Consulting & Coaching Solutions
|
||||
https://www.veen.world
|
||||
galaxy_tags:
|
||||
- cymais
|
||||
- meta
|
||||
- visualization
|
||||
- dependencies
|
||||
- graph
|
||||
repository: "https://github.com/kevinveenbirkenbach/meta-infinite-graph"
|
||||
issue_tracker_url: "https://github.com/kevinveenbirkenbach/meta-infinite-graph/issues"
|
||||
documentation: "https://github.com/kevinveenbirkenbach/meta-infinite-graph/"
|
||||
logo:
|
||||
class: ""
|
||||
run_after: []
|
||||
dependencies:
|
||||
- sys-cli
|
35
roles/web-app-mig/tasks/main.yml
Normal file
35
roles/web-app-mig/tasks/main.yml
Normal file
@@ -0,0 +1,35 @@
|
||||
---
|
||||
- block:
|
||||
- name: Load docker compose vars
|
||||
include_vars:
|
||||
file: roles/docker-compose/vars/docker-compose.yml
|
||||
name: mig_docker_compose
|
||||
|
||||
- name: Set roles volume variable
|
||||
set_fact:
|
||||
mig_roles_meta_volume: "{{ mig_docker_compose.docker_compose.directories.volumes }}/roles/"
|
||||
|
||||
- name: Set roles list variable
|
||||
set_fact:
|
||||
mig_roles_meta_list: "{{ mig_roles_meta_volume }}list.json"
|
||||
|
||||
- name: "load docker, proxy for '{{application_id}}'"
|
||||
include_role:
|
||||
name: cmp-docker-proxy
|
||||
|
||||
- name: Create tree
|
||||
command: "cymais build tree --no-signal --alarm-timeout 0 -s {{ mig_roles_meta_volume }}"
|
||||
when:
|
||||
- mig_build_data
|
||||
|
||||
- name: Create roles list
|
||||
command: "cymais build roles_list --no-signal --alarm-timeout 0 -o {{ mig_roles_meta_list }}"
|
||||
when:
|
||||
- mig_build_data
|
||||
|
||||
- name: run the web-app-mig tasks once
|
||||
set_fact:
|
||||
run_once_docker_web_app_mig: true
|
||||
name: "Setup Meta Infinite Graph"
|
||||
when: run_once_docker_web_app_mig is not defined
|
||||
|
21
roles/web-app-mig/templates/docker-compose.yml.j2
Normal file
21
roles/web-app-mig/templates/docker-compose.yml.j2
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
{% include 'roles/docker-compose/templates/base.yml.j2' %}
|
||||
{{ application_id | get_entity_name }}:
|
||||
{% set container_port = 80 %}
|
||||
{% include 'roles/docker-container/templates/base.yml.j2' %}
|
||||
image: "{{ mig_image }}"
|
||||
container_name: "{{ mig_container }}"
|
||||
ports:
|
||||
- 127.0.0.1:{{ports.localhost.http[application_id]}}:{{ container_port }}
|
||||
build:
|
||||
context: "{{docker_repository_path}}"
|
||||
dockerfile: Dockerfile
|
||||
volumes:
|
||||
- "{{ mig_roles_meta_volume }}:/usr/share/nginx/html/roles:ro"
|
||||
- "{{ docker_repository_path }}:/usr/share/nginx/html"
|
||||
{% include 'roles/docker-container/templates/networks.yml.j2' %}
|
||||
{% include 'roles/docker-container/templates/healthcheck/curl.yml.j2' %}
|
||||
|
||||
{% include 'roles/docker-compose/templates/networks.yml.j2' %}
|
||||
|
||||
|
12
roles/web-app-mig/vars/main.yml
Normal file
12
roles/web-app-mig/vars/main.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
# General
|
||||
application_id: web-app-mig # ID of the application, should be the name of the role folder
|
||||
|
||||
# Docker
|
||||
docker_compose_flush_handlers: true
|
||||
docker_pull_git_repository: true
|
||||
docker_repository_address: "https://github.com/kevinveenbirkenbach/meta-infinite-graph"
|
||||
|
||||
# Helper variables
|
||||
mig_image: "mig:latest"
|
||||
mig_container: "mig"
|
||||
mig_build_data: "{{ applications | get_app_conf(application_id, 'build_data') }}"
|
Reference in New Issue
Block a user