From f6e2506a8e9446838cb3fa1f0f738506fdef4682 Mon Sep 17 00:00:00 2001 From: Linus Vogel Date: Sat, 22 Aug 2026 10:17:25 +0200 Subject: [PATCH] snapshot --- Cargo.toml | 3 +++ README.md | 41 +++++++++++++++++++++++++++++++++-------- src/main.rs | 8 +++++++- src/sls/mod.rs | 1 + 4 files changed, 44 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 13c0e95..759c8a0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,3 +7,6 @@ edition = "2024" [dependencies] config = "0.15.25" lfcm = { git = "https://gitea.linvogel.ch/linus/lfcm.git", tag = "v0.1.2" } +minijinja = "2.24.0" +serde-saphyr = "1.1.0" +serde_json = "1.0.151" diff --git a/README.md b/README.md index 1905eeb..4afba8e 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,35 @@ -# KEEL - Config Management as i like it +# KEEL - Config Management as I like it +KEEL is a distributed configuration management tool inspired by SaltStack. It is designed to manage large-scale infrastructure through a high-performance, scalable Master-Minion architecture. + +## πŸš€ Core Principles + +### Master-Minion Architecture +KEEL operates on a centralized management model: +* **The Master:** Acts as the central authority. It manages the distribution of states, handles communication between minions, and provides an interface for orchestrating complex workflows. The Master is responsible for determining which configuration applies to which host using the **Top File**. +* 0The Minion:** A lightweight agent installed on every managed host. Minions are responsible for "rendering" the desired state (the configuration) and applying it to the local system. Once the local system matches the desired state, the Minion reports the results back to the Master. + +### Declarative State Management +Instead of writing scripts to perform actions, you define the *desired state* of your system. KEEL ensures that the system moves toward that state, regardless of its starting condition. + +## πŸ—οΈ Key Concepts + +### πŸ—ΊοΈ The Top File +The `top.sls` (or equivalent) is the "map" of your infrastructure. It defines the relationship between your configuration states and your minions. It allows you to say: *"Apply these web server configurations to all hosts identified as 'web-servers'."* + +### πŸ“¦ States +States are the building blocks of KEEL. They describe what a system should look like (e.s. `package: nginx must be installed`, `service: nginx must be running`). + +### πŸ’Ž Pillars (Global Data) +Pillars allow you to inject data into your states. This is ideal for storing sensitive information (like API keys or passwords) or environment-specific variables (like database URLs) that are not part of the state logic itself. + +### 🌾 Grains (System Metadata) +Grains are local data collected from the Minion. They describe the "identity" of the host, such as its Operating System, CPU architecture, or IP address. This allows you to write conditional logic in your states (e.g., *"If OS is Ubuntu, use `apt`; if OS is CentOS, use `yum`"*). + +## πŸ› οΈ Workflow + +1. **Define:** You write **States** describing your desired infrastructure. + 2.s. **Map:** You update the **Top File** to assign those states to specific hosts. +3. **Push:** The **Master** communicates the intent to the **Minions**. +4. **Apply:** The **Minion** evaluates the current system state, executes necessary changes, and reports success or failure back to the Master. -## Principles -### Master-Minion architecture -Keel operates based on a Master-Minion architecture with a single master -and a minion per managed host. The master serves as a relay to communicate -with minions and provides an interface for the minions to interact with the -states and the top files. The minion renders and applies the states to -its system and reports back to the master once done. \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 0a3dd23..ec9026b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,10 +4,14 @@ extern crate lfcm; use crate::config::LFCMError; pub mod config; +pub mod sls; fn main() { + // TODO: handle some parameters + let master = true; + let config_res = crate::config::lfcm_load_config(vec![ - "/etc/keel/master.toml" + if master { "/etc/keel/master.toml" } else { "/etc/keel/minion.toml" }, ]); let config = match config_res { Ok(config) => config, @@ -21,4 +25,6 @@ fn main() { } }; + // TODO: possibly override config with command line arguments + } diff --git a/src/sls/mod.rs b/src/sls/mod.rs index e69de29..4ef87af 100644 --- a/src/sls/mod.rs +++ b/src/sls/mod.rs @@ -0,0 +1 @@ +pub mod parsing; \ No newline at end of file