Bladeren bron

started refactoring bpv2

xcad 6 maanden geleden
bovenliggende
commit
bfd9801d04
100 gewijzigde bestanden met toevoegingen van 741 en 0 verwijderingen
  1. 8 0
      .gitignore
  2. 7 0
      cli/__init__.py
  3. 17 0
      cli/__main__.py
  4. 4 0
      cli/core/__init__.py
  5. 113 0
      cli/core/app.py
  6. 46 0
      cli/core/command.py
  7. 53 0
      cli/core/helpers.py
  8. 40 0
      cli/core/models.py
  9. 0 0
      cli/core/repo.py
  10. 0 0
      cli/core/variables.py
  11. 39 0
      cli/modules/__init__.py
  12. 8 0
      cli/modules/ansible/__init__.py
  13. 19 0
      cli/modules/ansible/commands.py
  14. 8 0
      cli/modules/compose/__init__.py
  15. 76 0
      cli/modules/compose/commands.py
  16. 8 0
      cli/modules/docker/__init__.py
  17. 19 0
      cli/modules/docker/commands.py
  18. 8 0
      cli/modules/github_actions/__init__.py
  19. 23 0
      cli/modules/github_actions/commands.py
  20. 8 0
      cli/modules/gitlab_ci/__init__.py
  21. 23 0
      cli/modules/gitlab_ci/commands.py
  22. 8 0
      cli/modules/kestra/__init__.py
  23. 23 0
      cli/modules/kestra/commands.py
  24. 8 0
      cli/modules/kubernetes/__init__.py
  25. 23 0
      cli/modules/kubernetes/commands.py
  26. 8 0
      cli/modules/packer/__init__.py
  27. 23 0
      cli/modules/packer/commands.py
  28. 8 0
      cli/modules/terraform/__init__.py
  29. 23 0
      cli/modules/terraform/commands.py
  30. 8 0
      cli/modules/vagrant/__init__.py
  31. 23 0
      cli/modules/vagrant/commands.py
  32. 0 0
      library/ansible/checkmk/activate-changes.yaml
  33. 0 0
      library/ansible/checkmk/install-agent.yaml
  34. 0 0
      library/ansible/checkmk/lookup-rule.yaml
  35. 0 0
      library/ansible/checkmk/manage-hosts.yaml
  36. 0 0
      library/ansible/checkmk/manage-rules.yaml
  37. 0 0
      library/ansible/checkmk/secrets.yaml
  38. 0 0
      library/ansible/discord/notify-discord.yaml
  39. 0 0
      library/ansible/docker/docker-certs-enable.yaml
  40. 0 0
      library/ansible/docker/docker-certs.yaml
  41. 0 0
      library/ansible/docker/inst-docker-ubuntu.yaml
  42. 59 0
      library/ansible/docker/install-docker-ubuntu.yml
  43. 0 0
      library/ansible/docker/maint-docker-clean.yaml
  44. 0 0
      library/ansible/kubernetes/README.md
  45. 0 0
      library/ansible/kubernetes/ansible.cfg
  46. 0 0
      library/ansible/kubernetes/inst-k8s.yaml
  47. 0 0
      library/ansible/kubernetes/k8s_worker_node_connection.j2
  48. 0 0
      library/ansible/portainer/deploy-portainer.yaml
  49. 0 0
      library/ansible/traefik/deploy-traefik.yaml
  50. 0 0
      library/ansible/ubuntu/config-add-sshkey.yaml
  51. 0 0
      library/ansible/ubuntu/inst-qemu-agent.yaml
  52. 0 0
      library/ansible/ubuntu/inst-vm-core.yaml
  53. 0 0
      library/ansible/ubuntu/inst-zsh.yaml
  54. 0 0
      library/ansible/ubuntu/maint-diskspace.yaml
  55. 0 0
      library/ansible/ubuntu/maint-reboot-required.yaml
  56. 0 0
      library/ansible/ubuntu/maint-reboot.yaml
  57. 0 0
      library/ansible/ubuntu/upd-apt.yaml
  58. 0 0
      library/ansible/wireguard/inst-wireguard.yaml
  59. 0 0
      library/compose/alloy/compose.yaml
  60. 0 0
      library/compose/alloy/config.alloy
  61. 0 0
      library/compose/ansiblesemaphore/compose.yaml
  62. 0 0
      library/compose/authentik/compose.yaml
  63. 0 0
      library/compose/bind9/compose.yaml
  64. 0 0
      library/compose/bind9/config/example.named.conf
  65. 0 0
      library/compose/cadvisor/compose.yaml
  66. 0 0
      library/compose/checkmk/compose.yaml
  67. 0 0
      library/compose/clamav/compose.yaml
  68. 0 0
      library/compose/clamav/config/clamd.conf
  69. 0 0
      library/compose/clamav/config/freshclam.conf
  70. 0 0
      library/compose/dockge/compose.yaml
  71. 0 0
      library/compose/duplicati/compose.yaml
  72. 0 0
      library/compose/factory/README.md
  73. 0 0
      library/compose/factory/runner-pool/compose.yaml
  74. 0 0
      library/compose/gitea/.env.example
  75. 0 0
      library/compose/gitea/compose.yaml
  76. 0 0
      library/compose/gitlab-runner/compose.yaml
  77. 0 0
      library/compose/gitlab-runner/config/config.toml
  78. 0 0
      library/compose/gitlab/compose.yaml
  79. 0 0
      library/compose/gitlab/config/gitlab.rb
  80. 0 0
      library/compose/grafana/compose.yaml
  81. 0 0
      library/compose/heimdall/compose.yaml
  82. 0 0
      library/compose/homeassistant/compose.yaml
  83. 0 0
      library/compose/homepage/compose.yaml
  84. 0 0
      library/compose/homer/assets/example.config.yml
  85. 0 0
      library/compose/homer/assets/example.custom.css
  86. 0 0
      library/compose/homer/assets/example2.config.yml
  87. 0 0
      library/compose/homer/compose.yaml
  88. 0 0
      library/compose/influxdb/compose.yaml
  89. 0 0
      library/compose/loki/compose.yaml
  90. 0 0
      library/compose/loki/config/config.yaml
  91. 0 0
      library/compose/mariadb/compose.yaml
  92. 0 0
      library/compose/nextcloud/compose.yaml
  93. 0 0
      library/compose/nginx/compose.yaml
  94. 0 0
      library/compose/nginx/config/default.conf
  95. 0 0
      library/compose/nginx/data/index.html
  96. 0 0
      library/compose/nginxproxymanager/compose.yaml
  97. 0 0
      library/compose/nodeexporter/compose.yaml
  98. 0 0
      library/compose/nvidiadgcm/compose.yaml
  99. 0 0
      library/compose/nvidiasmi/compose.yaml
  100. 0 0
      library/compose/openwebui/compose.yaml

+ 8 - 0
.gitignore

@@ -8,3 +8,11 @@
 
 # Ignore Ansible
 **/.ansible
+
+# Python
+**/__pycache__/
+**/*.py[cod]
+**/*.pyo
+**/*.pyd
+**/.venv
+**/venv/

+ 7 - 0
cli/__init__.py

@@ -0,0 +1,7 @@
+"""
+Boilerplates CLI - A sophisticated command-line tool for managing infrastructure boilerplates.
+"""
+
+__version__ = "1.0.0"
+__author__ = "Christian Lempa"
+__description__ = "CLI tool for managing infrastructure boilerplates"

+ 17 - 0
cli/__main__.py

@@ -0,0 +1,17 @@
+#!/usr/bin/env python3
+"""
+Main entry point for the Boilerplates CLI application.
+This file serves as the primary executable when running the CLI.
+"""
+
+from cli.core.app import create_app
+
+
+def main() -> None:
+    """Main entry point for the CLI application."""
+    app = create_app()
+    app()
+
+
+if __name__ == "__main__":
+    main()

+ 4 - 0
cli/core/__init__.py

@@ -0,0 +1,4 @@
+"""
+Core module for the Boilerplates CLI.
+Contains shared utilities, configuration, and base classes.
+"""

+ 113 - 0
cli/core/app.py

@@ -0,0 +1,113 @@
+"""
+Main application factory and CLI entry point.
+Creates and configures the main Typer application with all modules.
+"""
+
+import logging
+import sys
+from pathlib import Path
+from typing import Optional
+
+import typer
+from rich.console import Console
+from rich.traceback import install
+
+from cli import __version__
+from ..modules import get_all_modules
+
+
+def setup_logging(log_level: str = "WARNING") -> logging.Logger:
+    """Setup basic logging configuration."""
+    # Configure root logger
+    logging.basicConfig(
+        level=getattr(logging, log_level.upper()),
+        format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
+        datefmt='%Y-%m-%d %H:%M:%S',
+        handlers=[logging.StreamHandler(sys.stderr)]
+    )
+    
+    return logging.getLogger("boilerplates")
+
+
+def version_callback(value: bool):
+    """Callback for version option."""
+    if value:
+        console = Console()
+        console.print(f"Boilerplates CLI v{__version__}", style="bold blue")
+        raise typer.Exit()
+
+
+def create_app() -> typer.Typer:
+    """
+    Create and configure the main CLI application.
+    
+    Returns:
+        Configured Typer application with all modules registered.
+    """
+    # Install rich traceback handler for better error display
+    install(show_locals=True)
+    
+    # Create main app
+    app = typer.Typer(
+        name="boilerplates",
+        help="🚀 Sophisticated CLI tool for managing infrastructure boilerplates",
+        epilog="Made with ❤️  by Christian Lempa",
+        rich_markup_mode="rich",
+        no_args_is_help=True,
+    )
+    
+    @app.callback()
+    def main(
+        ctx: typer.Context,
+        version: Optional[bool] = typer.Option(
+            None, 
+            "--version", 
+            "-v",
+            callback=version_callback,
+            is_eager=True,
+            help="Show version and exit"
+        ),
+        log_level: str = typer.Option(
+            "WARNING",
+            "--log-level",
+            "-l",
+            help="Set logging level",
+            case_sensitive=False,
+        ),
+        verbose: bool = typer.Option(
+            False,
+            "--verbose",
+            help="Enable verbose output"
+        ),
+        quiet: bool = typer.Option(
+            False,
+            "--quiet",
+            "-q",
+            help="Suppress output"
+        ),
+    ):
+        """
+        🚀 Boilerplates CLI - Manage your infrastructure templates with ease!
+        """
+        
+        # Configure logging
+        setup_logging(log_level=log_level.upper())
+        
+        # Store context for subcommands
+        ctx.ensure_object(dict)
+    
+    # Register all module commands
+    modules = get_all_modules()
+    for module in modules:
+        try:
+            module_app = module.get_app()
+            app.add_typer(
+                module_app,
+                name=module.name,
+                # Don't override help - let the module define it
+            )
+            logging.getLogger("boilerplates.app").info(f"Registered module: {module.name}")
+        except Exception as e:
+            logging.getLogger("boilerplates.app").error(f"Failed to register module {module.name}: {e}")
+    
+    return app

+ 46 - 0
cli/core/command.py

@@ -0,0 +1,46 @@
+"""
+Base classes and utilities for CLI modules and commands.
+Provides common functionality and patterns for all modules.
+"""
+
+import logging
+from abc import ABC
+from typing import Optional
+
+import typer
+from rich.console import Console
+
+
+
+class BaseModule(ABC):
+    """Abstract base class for all CLI modules with shared commands."""
+    
+    def __init__(self, name: str, icon: str = "", description: str = ""):
+        self.name = name
+        self.icon = icon
+        self.description = description
+        self.console = Console()
+        self.logger = logging.getLogger(f"boilerplates.module.{name}")
+    
+    def get_app(self) -> typer.Typer:
+        """
+        Create and return the Typer app with shared commands.
+        Subclasses can override this to add module-specific commands.
+        """
+        app = typer.Typer(
+            name=self.name,
+            help=f"{self.icon} {self.description}",
+            rich_markup_mode="rich"
+        )
+        
+        # Add module-specific commands
+        self._add_module_commands(app)
+        
+        return app
+    
+    def _add_module_commands(self, app: typer.Typer) -> None:
+        """
+        Override this method in subclasses to add module-specific commands.
+        This is called after the shared commands are added.
+        """
+        pass

+ 53 - 0
cli/core/helpers.py

@@ -0,0 +1,53 @@
+"""
+Helper functions for common boilerplate operations.
+Provides reusable utilities for scanning directories and formatting output.
+"""
+
+from pathlib import Path
+from typing import List
+import frontmatter
+
+from .models import Boilerplate
+
+
+def find_boilerplates(library_path: Path, file_names: List[str]) -> List[Boilerplate]:
+    """
+    Find all boilerplate files in the library directory and extract metadata.
+    
+    Args:
+        library_path: Path to the library directory to scan
+        file_names: List of file names to search for (e.g., ['compose.yaml', 'docker-compose.yaml'])
+    
+    Returns:
+        List of Boilerplate objects sorted by name
+    """
+    boilerplates = []
+    
+    # Recursively scan all directories
+    for boilerplate_file in library_path.rglob("*"):
+        if boilerplate_file.is_file() and boilerplate_file.name in file_names:
+            try:
+                # Parse frontmatter
+                with open(boilerplate_file, 'r', encoding='utf-8') as f:
+                    post = frontmatter.load(f)
+                    boilerplate = Boilerplate(boilerplate_file, post.metadata, post.content)
+                    
+                    # If no name in frontmatter, use a meaningful name based on path
+                    if boilerplate.name == boilerplate_file.stem:
+                        # For nested paths like factory/runner-pool, use "Factory Runner Pool"
+                        relative_path = boilerplate_file.relative_to(library_path)
+                        path_parts = relative_path.parent.parts
+                        boilerplate.name = " ".join(part.replace("_", " ").replace("-", " ").title() for part in path_parts)
+                    
+                    boilerplates.append(boilerplate)
+                    
+            except Exception as e:
+                # If frontmatter parsing fails, create basic info
+                boilerplate = Boilerplate(boilerplate_file, {}, "")
+                relative_path = boilerplate_file.relative_to(library_path)
+                path_parts = relative_path.parent.parts
+                boilerplate.name = " ".join(part.replace("_", " ").replace("-", " ").title() for part in path_parts)
+                boilerplates.append(boilerplate)
+    
+    return sorted(boilerplates, key=lambda x: x.name)
+

+ 40 - 0
cli/core/models.py

@@ -0,0 +1,40 @@
+"""
+Data models and structures for the CLI application.
+Contains classes that represent boilerplate information and other data structures.
+"""
+
+from pathlib import Path
+from typing import Any, Dict, List
+
+
+class Boilerplate:
+    """Data class for boilerplate information extracted from frontmatter."""
+    
+    def __init__(self, file_path: Path, frontmatter_data: Dict[str, Any], content: str):
+        self.file_path = file_path
+        self.content = content
+        
+        # Extract frontmatter fields with defaults
+        self.name = frontmatter_data.get('name', file_path.stem)
+        self.description = frontmatter_data.get('description', 'No description available')
+        self.author = frontmatter_data.get('author', 'Unknown')
+        self.date = frontmatter_data.get('date', 'Unknown')
+        self.module = frontmatter_data.get('module', 'Unknown')
+        self.files = frontmatter_data.get('files', [])
+        
+        # Additional computed properties
+        self.relative_path = file_path.name
+        self.size = file_path.stat().st_size if file_path.exists() else 0
+    
+    def to_dict(self) -> Dict[str, Any]:
+        """Convert to dictionary for display."""
+        return {
+            'name': self.name,
+            'description': self.description,
+            'author': self.author,
+            'date': self.date,
+            'module': self.module,
+            'files': self.files,
+            'path': str(self.relative_path),
+            'size': f"{self.size:,} bytes"
+        }

+ 0 - 0
cli/core/repo.py


+ 0 - 0
cli/core/variables.py


+ 39 - 0
cli/modules/__init__.py

@@ -0,0 +1,39 @@
+"""
+Modules package for the Boilerplates CLI.
+Contains all module implementations for different infrastructure types.
+"""
+
+from typing import List
+from .ansible import AnsibleModule
+from .docker import DockerModule
+from .compose import ComposeModule
+from .github_actions import GitHubActionsModule
+from .gitlab_ci import GitLabCIModule
+from .kestra import KestraModule
+from .kubernetes import KubernetesModule
+from .packer import PackerModule
+from .terraform import TerraformModule
+from .vagrant import VagrantModule
+
+from ..core.command import BaseModule
+
+
+def get_all_modules() -> List[BaseModule]:
+    """
+    Get all available CLI modules.
+    
+    Returns:
+        List of initialized module instances.
+    """
+    return [
+        AnsibleModule(),
+        DockerModule(),
+        ComposeModule(),
+        GitHubActionsModule(),
+        GitLabCIModule(),
+        KestraModule(),
+        KubernetesModule(),
+        PackerModule(),
+        TerraformModule(),
+        VagrantModule(),
+    ]

+ 8 - 0
cli/modules/ansible/__init__.py

@@ -0,0 +1,8 @@
+"""
+Ansible module for the Boilerplates CLI.
+Provides commands for managing Ansible playbooks and configurations.
+"""
+
+from .commands import AnsibleModule
+
+__all__ = ["AnsibleModule"]

+ 19 - 0
cli/modules/ansible/commands.py

@@ -0,0 +1,19 @@
+"""
+Ansible module commands and functionality.
+Handles Ansible playbook management with shared base commands.
+"""
+
+from typing import Optional
+import typer
+from ...core.command import BaseModule
+
+
+class AnsibleModule(BaseModule):
+    """Module for managing Ansible playbooks and configurations."""
+    
+    def __init__(self):
+        super().__init__(name="ansible", icon="🎭", description="Manage Ansible playbooks and configurations")
+    
+    def add_module_commands(self, app: typer.Typer) -> None:
+        """Add Module-specific commands to the app."""
+        pass

+ 8 - 0
cli/modules/compose/__init__.py

@@ -0,0 +1,8 @@
+"""
+Compose module for the Boilerplates CLI.
+Manage Compose configurations and services.
+"""
+
+from .commands import ComposeModule
+
+__all__ = ["ComposeModule"]

+ 76 - 0
cli/modules/compose/commands.py

@@ -0,0 +1,76 @@
+"""
+Compose module commands and functionality.
+Manage Compose configurations and services and template operations.
+"""
+
+import typer
+from pathlib import Path
+from rich.console import Console
+from rich.table import Table
+
+from ...core.command import BaseModule
+from ...core.helpers import find_boilerplates
+
+
+class ComposeModule(BaseModule):
+    """Module for managing compose boilerplates."""
+
+    def __init__(self):
+        super().__init__(name="compose", icon="🐳", description="Manage Compose Templates and Configurations")
+
+    def _add_module_commands(self, app: typer.Typer) -> None:
+        """Add Module-specific commands to the app."""
+
+        @app.command("list", help="List all compose boilerplates")
+        def list():
+            """List all compose boilerplates from library/compose directory."""
+            # Get the library/compose path
+            library_path = Path(__file__).parent.parent.parent.parent / "library" / "compose"
+            
+            # Define the compose file names to search for
+            compose_filenames = ["compose.yaml", "docker-compose.yaml", "compose.yml", "docker-compose.yml"]
+            
+            # Find all boilerplates
+            bps = find_boilerplates(library_path, compose_filenames)
+            
+            if not bps:
+                console = Console()
+                console.print("[yellow]No compose boilerplates found.[/yellow]")
+                return
+            
+            # Create a rich table
+            console = Console()
+            table = Table(title="🐳 Available Compose Boilerplates", title_style="bold blue")
+            
+            table.add_column("Name", style="cyan", no_wrap=True)
+            table.add_column("Module", style="magenta")
+            table.add_column("Path", style="green")
+            table.add_column("Size", justify="right", style="yellow")
+            table.add_column("Description", style="dim")
+            
+            for bp in bps:
+                # Format file size
+                if bp.size < 1024:
+                    size_str = f"{bp.size} B"
+                elif bp.size < 1024 * 1024:
+                    size_str = f"{bp.size // 1024} KB"
+                else:
+                    size_str = f"{bp.size // (1024 * 1024)} MB"
+                
+                table.add_row(
+                    bp.name,
+                    bp.module,
+                    str(bp.file_path.relative_to(library_path)),
+                    size_str,
+                    bp.description[:50] + "..." if len(bp.description) > 50 else bp.description
+                )
+            
+            console.print(table)
+
+        @app.command("show", help="Show details about a compose boilerplate")
+        def show(name: str):
+            pass
+
+        @app.command("search", help="Search compose boilerplates")
+        def search(query: str):
+            pass

+ 8 - 0
cli/modules/docker/__init__.py

@@ -0,0 +1,8 @@
+"""
+Docker module for the Boilerplates CLI.
+Provides commands for managing Docker configurations and containers.
+"""
+
+from .commands import DockerModule
+
+__all__ = ["DockerModule"]

+ 19 - 0
cli/modules/docker/commands.py

@@ -0,0 +1,19 @@
+"""
+Docker module commands and functionality.
+Handles Docker container management with shared base commands.
+"""
+
+from typing import Optional
+import typer
+from ...core.command import BaseModule
+
+
+class DockerModule(BaseModule):
+    """Module for managing Docker configurations and containers."""
+    
+    def __init__(self):
+        super().__init__(name="docker", icon="🐳", description="Manage Docker configurations and containers")
+
+    def add_module_commands(self, app: typer.Typer) -> None:
+        """Add Module-specific commands to the app."""
+        pass

+ 8 - 0
cli/modules/github_actions/__init__.py

@@ -0,0 +1,8 @@
+"""
+GitHub Actions module for the Boilerplates CLI.
+Manage GitHub Actions workflows and CI/CD.
+"""
+
+from .commands import GitHubActionsModule
+
+__all__ = ["GitHubActionsModule"]

+ 23 - 0
cli/modules/github_actions/commands.py

@@ -0,0 +1,23 @@
+"""
+GitHub Actions module commands and functionality.
+Manage GitHub Actions workflows and CI/CD and template operations.
+"""
+
+from pathlib import Path
+from typing import List, Optional
+
+import typer
+from rich.table import Table
+
+from ...core.command import BaseModule
+
+
+class GitHubActionsModule(BaseModule):
+    """Module for managing github actions configurations."""
+    
+    def __init__(self):
+        super().__init__(name="github_actions", icon="🚀", description="Manage GitHub Actions workflows and CI/CD")
+
+    def add_module_commands(self, app: typer.Typer) -> None:
+        """Add Module-specific commands to the app."""
+        pass

+ 8 - 0
cli/modules/gitlab_ci/__init__.py

@@ -0,0 +1,8 @@
+"""
+GitLab CI module for the Boilerplates CLI.
+Manage GitLab CI/CD pipelines and configurations.
+"""
+
+from .commands import GitLabCIModule
+
+__all__ = ["GitLabCIModule"]

+ 23 - 0
cli/modules/gitlab_ci/commands.py

@@ -0,0 +1,23 @@
+"""
+GitLab CI module commands and functionality.
+Manage GitLab CI/CD pipelines and configurations and template operations.
+"""
+
+from pathlib import Path
+from typing import List, Optional
+
+import typer
+from rich.table import Table
+
+from ...core.command import BaseModule
+
+
+class GitLabCIModule(BaseModule):
+    """Module for managing gitlab ci configurations."""
+
+    def __init__(self):
+        super().__init__(name="gitlab_ci", icon="🦊", description="Manage GitLab CI/CD pipelines and configurations")
+
+    def add_module_commands(self, app: typer.Typer) -> None:
+        """Add Module-specific commands to the app."""
+        pass

+ 8 - 0
cli/modules/kestra/__init__.py

@@ -0,0 +1,8 @@
+"""
+Kestra module for the Boilerplates CLI.
+Manage Kestra workflows and orchestration.
+"""
+
+from .commands import KestraModule
+
+__all__ = ["KestraModule"]

+ 23 - 0
cli/modules/kestra/commands.py

@@ -0,0 +1,23 @@
+"""
+Kestra module commands and functionality.
+Manage Kestra workflows and orchestration and template operations.
+"""
+
+from pathlib import Path
+from typing import List, Optional
+
+import typer
+from rich.table import Table
+
+from ...core.command import BaseModule
+
+
+class KestraModule(BaseModule):
+    """Module for managing Kestra workflows and orchestration."""
+
+    def __init__(self):
+        super().__init__(name="kestra", icon="⚡", description="Manage Kestra workflows and orchestration")
+
+    def add_module_commands(self, app: typer.Typer) -> None:
+        """Add Module-specific commands to the app."""
+        pass

+ 8 - 0
cli/modules/kubernetes/__init__.py

@@ -0,0 +1,8 @@
+"""
+Kubernetes module for the Boilerplates CLI.
+Manage Kubernetes deployments and configurations.
+"""
+
+from .commands import KubernetesModule
+
+__all__ = ["KubernetesModule"]

+ 23 - 0
cli/modules/kubernetes/commands.py

@@ -0,0 +1,23 @@
+"""
+Kubernetes module commands and functionality.
+Manage Kubernetes deployments and configurations and template operations.
+"""
+
+from pathlib import Path
+from typing import List, Optional
+
+import typer
+from rich.table import Table
+
+from ...core.command import BaseModule
+
+
+class KubernetesModule(BaseModule):
+    """Module for managing Kubernetes configurations."""
+
+    def __init__(self):
+        super().__init__(name="kubernetes", icon="☸️", description="Manage Kubernetes deployments and configurations")
+
+    def add_module_commands(self, app: typer.Typer) -> None:
+        """Add Module-specific commands to the app."""
+        pass

+ 8 - 0
cli/modules/packer/__init__.py

@@ -0,0 +1,8 @@
+"""
+Packer module for the Boilerplates CLI.
+Manage Packer templates and image building.
+"""
+
+from .commands import PackerModule
+
+__all__ = ["PackerModule"]

+ 23 - 0
cli/modules/packer/commands.py

@@ -0,0 +1,23 @@
+"""
+Packer module commands and functionality.
+Manage Packer templates and image building and template operations.
+"""
+
+from pathlib import Path
+from typing import List, Optional
+
+import typer
+from rich.table import Table
+
+from ...core.command import BaseModule
+
+
+class PackerModule(BaseModule):
+    """Module for managing Packer configurations."""
+
+    def __init__(self):
+        super().__init__(name="packer", icon="📦", description="Manage Packer templates and image building")
+
+    def add_module_commands(self, app: typer.Typer) -> None:
+        """Add Module-specific commands to the app."""
+        pass

+ 8 - 0
cli/modules/terraform/__init__.py

@@ -0,0 +1,8 @@
+"""
+Terraform module for the Boilerplates CLI.
+Manage Terraform infrastructure as code.
+"""
+
+from .commands import TerraformModule
+
+__all__ = ["TerraformModule"]

+ 23 - 0
cli/modules/terraform/commands.py

@@ -0,0 +1,23 @@
+"""
+Terraform module commands and functionality.
+Manage Terraform infrastructure as code and template operations.
+"""
+
+from pathlib import Path
+from typing import List, Optional
+
+import typer
+from rich.table import Table
+
+from ...core.command import BaseModule
+
+
+class TerraformModule(BaseModule):
+    """Module for managing terraform configurations."""
+    
+    def __init__(self):
+        super().__init__(name="terraform", icon="🏗️", description="Manage Terraform infrastructure as code")
+
+    def add_module_commands(self, app: typer.Typer) -> None:
+        """Add Module-specific commands to the app."""
+        pass

+ 8 - 0
cli/modules/vagrant/__init__.py

@@ -0,0 +1,8 @@
+"""
+Vagrant module for the Boilerplates CLI.
+Manage Vagrant environments and virtual machines.
+"""
+
+from .commands import VagrantModule
+
+__all__ = ["VagrantModule"]

+ 23 - 0
cli/modules/vagrant/commands.py

@@ -0,0 +1,23 @@
+"""
+Vagrant module commands and functionality.
+Manage Vagrant environments and virtual machines and template operations.
+"""
+
+from pathlib import Path
+from typing import List, Optional
+
+import typer
+from rich.table import Table
+
+from ...core.command import BaseModule
+
+
+class VagrantModule(BaseModule):
+    """Module for managing vagrant configurations."""
+    
+    def __init__(self):
+        super().__init__(name="vagrant", icon="📦", description="Manage Vagrant environments and virtual machines")
+
+    def add_module_commands(self, app: typer.Typer) -> None:
+        """Add Module-specific commands to the app."""
+        pass

+ 0 - 0
ansible/checkmk/activate-changes.yaml → library/ansible/checkmk/activate-changes.yaml


+ 0 - 0
ansible/checkmk/install-agent.yaml → library/ansible/checkmk/install-agent.yaml


+ 0 - 0
ansible/checkmk/lookup-rule.yaml → library/ansible/checkmk/lookup-rule.yaml


+ 0 - 0
ansible/checkmk/manage-hosts.yaml → library/ansible/checkmk/manage-hosts.yaml


+ 0 - 0
ansible/checkmk/manage-rules.yaml → library/ansible/checkmk/manage-rules.yaml


+ 0 - 0
ansible/checkmk/secrets.yaml → library/ansible/checkmk/secrets.yaml


+ 0 - 0
ansible/discord/notify-discord.yaml → library/ansible/discord/notify-discord.yaml


+ 0 - 0
ansible/docker/docker-certs-enable.yaml → library/ansible/docker/docker-certs-enable.yaml


+ 0 - 0
ansible/docker/docker-certs.yaml → library/ansible/docker/docker-certs.yaml


+ 0 - 0
ansible/docker/inst-docker-ubuntu.yaml → library/ansible/docker/inst-docker-ubuntu.yaml


+ 59 - 0
library/ansible/docker/install-docker-ubuntu.yml

@@ -0,0 +1,59 @@
+---
+name: Docker Ubuntu Installation
+description: Installs Docker on Ubuntu systems with best practices
+author: xcad (Christian Lempa)
+date: 2025-08-29
+module: ansible
+files:
+  - handlers/main.yml
+  - vars/main.yml
+---
+- name: Install Docker on Ubuntu
+  hosts: ubuntu_servers
+  become: true
+  
+  tasks:
+    - name: Update apt package index
+      apt:
+        update_cache: yes
+        cache_valid_time: 3600
+    
+    - name: Install dependencies
+      apt:
+        name:
+          - apt-transport-https
+          - ca-certificates
+          - curl
+          - gnupg
+          - lsb-release
+        state: present
+    
+    - name: Add Docker GPG key
+      apt_key:
+        url: https://download.docker.com/linux/ubuntu/gpg
+        state: present
+    
+    - name: Add Docker repository
+      apt_repository:
+        repo: "deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable"
+        state: present
+    
+    - name: Install Docker CE
+      apt:
+        name:
+          - docker-ce
+          - docker-ce-cli
+          - containerd.io
+        state: present
+    
+    - name: Start and enable Docker service
+      systemd:
+        name: docker
+        state: started
+        enabled: yes
+    
+    - name: Add user to docker group
+      user:
+        name: "{{ ansible_user }}"
+        groups: docker
+        append: yes

+ 0 - 0
ansible/docker/maint-docker-clean.yaml → library/ansible/docker/maint-docker-clean.yaml


+ 0 - 0
ansible/kubernetes/README.md → library/ansible/kubernetes/README.md


+ 0 - 0
ansible/kubernetes/ansible.cfg → library/ansible/kubernetes/ansible.cfg


+ 0 - 0
ansible/kubernetes/inst-k8s.yaml → library/ansible/kubernetes/inst-k8s.yaml


+ 0 - 0
ansible/kubernetes/k8s_worker_node_connection.j2 → library/ansible/kubernetes/k8s_worker_node_connection.j2


+ 0 - 0
ansible/portainer/deploy-portainer.yaml → library/ansible/portainer/deploy-portainer.yaml


+ 0 - 0
ansible/traefik/deploy-traefik.yaml → library/ansible/traefik/deploy-traefik.yaml


+ 0 - 0
ansible/ubuntu/config-add-sshkey.yaml → library/ansible/ubuntu/config-add-sshkey.yaml


+ 0 - 0
ansible/ubuntu/inst-qemu-agent.yaml → library/ansible/ubuntu/inst-qemu-agent.yaml


+ 0 - 0
ansible/ubuntu/inst-vm-core.yaml → library/ansible/ubuntu/inst-vm-core.yaml


+ 0 - 0
ansible/ubuntu/inst-zsh.yaml → library/ansible/ubuntu/inst-zsh.yaml


+ 0 - 0
ansible/ubuntu/maint-diskspace.yaml → library/ansible/ubuntu/maint-diskspace.yaml


+ 0 - 0
ansible/ubuntu/maint-reboot-required.yaml → library/ansible/ubuntu/maint-reboot-required.yaml


+ 0 - 0
ansible/ubuntu/maint-reboot.yaml → library/ansible/ubuntu/maint-reboot.yaml


+ 0 - 0
ansible/ubuntu/upd-apt.yaml → library/ansible/ubuntu/upd-apt.yaml


+ 0 - 0
ansible/wireguard/inst-wireguard.yaml → library/ansible/wireguard/inst-wireguard.yaml


+ 0 - 0
docker-compose/alloy/compose.yaml → library/compose/alloy/compose.yaml


+ 0 - 0
docker-compose/alloy/config.alloy → library/compose/alloy/config.alloy


+ 0 - 0
docker-compose/ansiblesemaphore/compose.yaml → library/compose/ansiblesemaphore/compose.yaml


+ 0 - 0
docker-compose/authentik/compose.yaml → library/compose/authentik/compose.yaml


+ 0 - 0
docker-compose/bind9/compose.yaml → library/compose/bind9/compose.yaml


+ 0 - 0
docker-compose/bind9/config/example.named.conf → library/compose/bind9/config/example.named.conf


+ 0 - 0
docker-compose/cadvisor/compose.yaml → library/compose/cadvisor/compose.yaml


+ 0 - 0
docker-compose/checkmk/compose.yaml → library/compose/checkmk/compose.yaml


+ 0 - 0
docker-compose/clamav/compose.yaml → library/compose/clamav/compose.yaml


+ 0 - 0
docker-compose/clamav/config/clamd.conf → library/compose/clamav/config/clamd.conf


+ 0 - 0
docker-compose/clamav/config/freshclam.conf → library/compose/clamav/config/freshclam.conf


+ 0 - 0
docker-compose/dockge/compose.yaml → library/compose/dockge/compose.yaml


+ 0 - 0
docker-compose/duplicati/compose.yaml → library/compose/duplicati/compose.yaml


+ 0 - 0
docker-compose/factory/README.md → library/compose/factory/README.md


+ 0 - 0
docker-compose/factory/runner-pool/compose.yaml → library/compose/factory/runner-pool/compose.yaml


+ 0 - 0
docker-compose/gitea/.env.example → library/compose/gitea/.env.example


+ 0 - 0
docker-compose/gitea/compose.yaml → library/compose/gitea/compose.yaml


+ 0 - 0
docker-compose/gitlab-runner/compose.yaml → library/compose/gitlab-runner/compose.yaml


+ 0 - 0
docker-compose/gitlab-runner/config/config.toml → library/compose/gitlab-runner/config/config.toml


+ 0 - 0
docker-compose/gitlab/compose.yaml → library/compose/gitlab/compose.yaml


+ 0 - 0
docker-compose/gitlab/config/gitlab.rb → library/compose/gitlab/config/gitlab.rb


+ 0 - 0
docker-compose/grafana/compose.yaml → library/compose/grafana/compose.yaml


+ 0 - 0
docker-compose/heimdall/compose.yaml → library/compose/heimdall/compose.yaml


+ 0 - 0
docker-compose/homeassistant/compose.yaml → library/compose/homeassistant/compose.yaml


+ 0 - 0
docker-compose/homepage/compose.yaml → library/compose/homepage/compose.yaml


+ 0 - 0
docker-compose/homer/assets/example.config.yml → library/compose/homer/assets/example.config.yml


+ 0 - 0
docker-compose/homer/assets/example.custom.css → library/compose/homer/assets/example.custom.css


+ 0 - 0
docker-compose/homer/assets/example2.config.yml → library/compose/homer/assets/example2.config.yml


+ 0 - 0
docker-compose/homer/compose.yaml → library/compose/homer/compose.yaml


+ 0 - 0
docker-compose/influxdb/compose.yaml → library/compose/influxdb/compose.yaml


+ 0 - 0
docker-compose/loki/compose.yaml → library/compose/loki/compose.yaml


+ 0 - 0
docker-compose/loki/config/config.yaml → library/compose/loki/config/config.yaml


+ 0 - 0
docker-compose/mariadb/compose.yaml → library/compose/mariadb/compose.yaml


+ 0 - 0
docker-compose/nextcloud/compose.yaml → library/compose/nextcloud/compose.yaml


+ 0 - 0
docker-compose/nginx/compose.yaml → library/compose/nginx/compose.yaml


+ 0 - 0
docker-compose/nginx/config/default.conf → library/compose/nginx/config/default.conf


+ 0 - 0
docker-compose/nginx/data/index.html → library/compose/nginx/data/index.html


+ 0 - 0
docker-compose/nginxproxymanager/compose.yaml → library/compose/nginxproxymanager/compose.yaml


+ 0 - 0
docker-compose/nodeexporter/compose.yaml → library/compose/nodeexporter/compose.yaml


+ 0 - 0
docker-compose/nvidiadgcm/compose.yaml → library/compose/nvidiadgcm/compose.yaml


+ 0 - 0
docker-compose/nvidiasmi/compose.yaml → library/compose/nvidiasmi/compose.yaml


+ 0 - 0
docker-compose/openwebui/compose.yaml → library/compose/openwebui/compose.yaml


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