prvng_kcl/settings.k
2025-10-07 11:17:54 +01:00

152 lines
5.3 KiB
Plaintext

# Info: KCL core lib settings schemas for provisioning (Provisioning)
# Author: JesusPerezLorenzo
# Release: 0.0.4
# Date: 15-12-2023
schema SecretProvider:
"""
Secret provider configuration for SOPS or KMS
"""
# Secret provider type: sops or kms
provider: "sops" | "kms" = "sops"
# Configuration specific to SOPS
sops_config?: SopsConfig
# Configuration specific to KMS
kms_config?: KmsConfig
schema SopsConfig:
"""
SOPS configuration settings
"""
# Path to SOPS configuration file
config_path?: str
# Path to Age key file for encryption
age_key_file?: str
# Age recipients for encryption
age_recipients?: str
# Use Age encryption (default) or other methods
use_age: bool = True
schema KmsConfig:
"""
KMS configuration settings for Cosmian KMS
"""
# KMS server URL
server_url: str
# Authentication method: certificate, token, or basic
auth_method: "certificate" | "token" | "basic" = "certificate"
# Client certificate path (for certificate auth)
client_cert_path?: str
# Client private key path (for certificate auth)
client_key_path?: str
# CA certificate path for server verification
ca_cert_path?: str
# API token (for token auth)
api_token?: str
# Username (for basic auth)
username?: str
# Password (for basic auth)
password?: str
# Timeout for requests in seconds
timeout: int = 30
# Verify SSL certificates
verify_ssl: bool = True
schema AIProvider:
"""
AI provider configuration for natural language processing
"""
# Enable AI capabilities
enabled: bool = False
# AI provider type: openai, claude, or generic
provider: "openai" | "claude" | "generic" = "openai"
# API endpoint URL (for generic provider or custom endpoints)
api_endpoint?: str
# API key for authentication
api_key?: str
# Model name to use
model?: str
# Maximum tokens for responses
max_tokens: int = 2048
# Temperature for response creativity (0.0-1.0)
temperature: float = 0.3
# Timeout for API requests in seconds
timeout: int = 30
# Enable AI for template generation
enable_template_ai: bool = True
# Enable AI for queries
enable_query_ai: bool = True
# Enable AI for webhooks/chat interfaces
enable_webhook_ai: bool = False
schema RunSet:
# Wait until requested taskserv is completed: true or false
wait: bool = True
# Format for output: human (defaul) | yaml | json
# Server info can be requested via aws cli adding option: --out yam l| json |text | table
output_format: "human" | "yaml" | "json" = "human"
# Output path to copy results
output_path: str = "tmp/NOW-deploy"
# Inventory file
inventory_file: str = "./inventory.yaml"
# Use 'time' to get time info for commands if is not empty
use_time: bool = True
schema Settings:
"""
Settings
"""
# Main name for provisonning
main_name: str
main_title: str = main_name
# #provider: "local" | "upcloud" | "aws"
# # Settings from servers has priority over these defaults ones, if a value is not set in server item, defaults one will be used instead
# #defaults_path: str = "../defaults.yaml"
# Settings Data is AUTO Generated, Checked and AUTO Filled during operations taskservs
# Path for Automatic generasetings for VPC, Subnets, SG, etc.
settings_path: str = "./settings.yaml"
# Directory path for providers default-settings
defaults_provs_dirpath: str = "./defs"
# Suffix for providers default-settings filenames with extension (example: aws_defaults.k)
defaults_provs_suffix: str = "_defaults.k"
# Provision data directory path to save providers specific settings (uuids, vpc, etc)
prov_data_dirpath: str = "./data"
# Suffix for providers data-settings filenames with extension (example: aws_settings.k)
prov_data_suffix: str = "_settings.k"
# Directory path to collect created infos, taskservs
created_taskservs_dirpath: str = "./tmp/NOW_deployment"
# Directory path to collect resources for provisioning created infos, taskservs
prov_resources_path: str = "./resources"
# Directory path to collect created clusters
created_clusters_dirpath: str = "./tmp/NOW_clusters"
# Directory path to collect clusters for provisioning
prov_clusters_path: str = "./clusters"
# Directory path for local bin on provisioning
prov_local_bin_path: str = "./bin"
# Secret management configuration
secrets: SecretProvider = SecretProvider {}
# AI provider configuration
ai: AIProvider = AIProvider {}
runset: RunSet
# Default values can be overwrite by cluster setting
# Cluster clusters admin hosts to connect via SSH
cluster_admin_host: str
# Cluster clusters admin hosts port to connect via SSH
cluster_admin_port: int = 22
# Time to wait in seconds for servers for started state and ssh
servers_wait_started: int = 27
# Cluster clusters admin user connect via SSH
cluster_admin_user: str = "root"
# Services Save path or use main settings
clusters_save_path: str = "/${main_name}/clusters"
# Servers path
servers_paths: [str] = ["servers"]
# Common clusters definitions, mainly Cluster ones
clusters_paths: [str] = ["clusters"]
#clusters: [str] = [ "clusters" ]
#check:
# len(provider) > 0, "Check provider value"