provisioning/docs/book/quickstart/02-installation.html

429 lines
19 KiB
HTML
Raw Normal View History

<!DOCTYPE HTML>
<html lang="en" class="ayu sidebar-visible" dir="ltr">
<head>
<!-- Book generated using mdBook -->
<meta charset="UTF-8">
<title>Installation - Provisioning Platform Documentation</title>
<!-- Custom HTML head -->
<meta name="description" content="Complete documentation for the Provisioning Platform - Infrastructure automation with Nushell, KCL, and Rust">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#ffffff">
<link rel="icon" href="../favicon.svg">
<link rel="shortcut icon" href="../favicon.png">
<link rel="stylesheet" href="../css/variables.css">
<link rel="stylesheet" href="../css/general.css">
<link rel="stylesheet" href="../css/chrome.css">
<link rel="stylesheet" href="../css/print.css" media="print">
<!-- Fonts -->
<link rel="stylesheet" href="../FontAwesome/css/font-awesome.css">
<link rel="stylesheet" href="../fonts/fonts.css">
<!-- Highlight.js Stylesheets -->
<link rel="stylesheet" id="highlight-css" href="../highlight.css">
<link rel="stylesheet" id="tomorrow-night-css" href="../tomorrow-night.css">
<link rel="stylesheet" id="ayu-highlight-css" href="../ayu-highlight.css">
<!-- Custom theme stylesheets -->
<!-- Provide site root and default themes to javascript -->
<script>
const path_to_root = "../";
const default_light_theme = "ayu";
const default_dark_theme = "navy";
</script>
<!-- Start loading toc.js asap -->
<script src="../toc.js"></script>
</head>
<body>
<div id="mdbook-help-container">
<div id="mdbook-help-popup">
<h2 class="mdbook-help-title">Keyboard shortcuts</h2>
<div>
<p>Press <kbd></kbd> or <kbd></kbd> to navigate between chapters</p>
<p>Press <kbd>S</kbd> or <kbd>/</kbd> to search in the book</p>
<p>Press <kbd>?</kbd> to show this help</p>
<p>Press <kbd>Esc</kbd> to hide this help</p>
</div>
</div>
</div>
<div id="body-container">
<!-- Work around some values being stored in localStorage wrapped in quotes -->
<script>
try {
let theme = localStorage.getItem('mdbook-theme');
let sidebar = localStorage.getItem('mdbook-sidebar');
if (theme.startsWith('"') && theme.endsWith('"')) {
localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
}
if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
}
} catch (e) { }
</script>
<!-- Set the theme before any content is loaded, prevents flash -->
<script>
const default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? default_dark_theme : default_light_theme;
let theme;
try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
if (theme === null || theme === undefined) { theme = default_theme; }
const html = document.documentElement;
html.classList.remove('ayu')
html.classList.add(theme);
html.classList.add("js");
</script>
<input type="checkbox" id="sidebar-toggle-anchor" class="hidden">
<!-- Hide / unhide sidebar before it is displayed -->
<script>
let sidebar = null;
const sidebar_toggle = document.getElementById("sidebar-toggle-anchor");
if (document.body.clientWidth >= 1080) {
try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
sidebar = sidebar || 'visible';
} else {
sidebar = 'hidden';
}
sidebar_toggle.checked = sidebar === 'visible';
html.classList.remove('sidebar-visible');
html.classList.add("sidebar-" + sidebar);
</script>
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
<!-- populated by js -->
<mdbook-sidebar-scrollbox class="sidebar-scrollbox"></mdbook-sidebar-scrollbox>
<noscript>
<iframe class="sidebar-iframe-outer" src="../toc.html"></iframe>
</noscript>
<div id="sidebar-resize-handle" class="sidebar-resize-handle">
<div class="sidebar-resize-indicator"></div>
</div>
</nav>
<div id="page-wrapper" class="page-wrapper">
<div class="page">
<div id="menu-bar-hover-placeholder"></div>
<div id="menu-bar" class="menu-bar sticky">
<div class="left-buttons">
<label id="sidebar-toggle" class="icon-button" for="sidebar-toggle-anchor" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
<i class="fa fa-bars"></i>
</label>
<button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
<i class="fa fa-paint-brush"></i>
</button>
<ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
<li role="none"><button role="menuitem" class="theme" id="default_theme">Auto</button></li>
<li role="none"><button role="menuitem" class="theme" id="light">Light</button></li>
<li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li>
<li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li>
<li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li>
<li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li>
</ul>
<button id="search-toggle" class="icon-button" type="button" title="Search (`/`)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="/ s" aria-controls="searchbar">
<i class="fa fa-search"></i>
</button>
</div>
<h1 class="menu-title">Provisioning Platform Documentation</h1>
<div class="right-buttons">
<a href="../print.html" title="Print this book" aria-label="Print this book">
<i id="print-button" class="fa fa-print"></i>
</a>
<a href="https://github.com/provisioning/provisioning-platform" title="Git repository" aria-label="Git repository">
<i id="git-repository-button" class="fa fa-github"></i>
</a>
<a href="https://github.com/provisioning/provisioning-platform/edit/main/provisioning/docs/src/quickstart/02-installation.md" title="Suggest an edit" aria-label="Suggest an edit">
<i id="git-edit-button" class="fa fa-edit"></i>
</a>
</div>
</div>
<div id="search-wrapper" class="hidden">
<form id="searchbar-outer" class="searchbar-outer">
<input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
</form>
<div id="searchresults-outer" class="searchresults-outer hidden">
<div id="searchresults-header" class="searchresults-header"></div>
<ul id="searchresults">
</ul>
</div>
</div>
<!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
<script>
document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
});
</script>
<div id="content" class="content">
<main>
<h1 id="installation"><a class="header" href="#installation">Installation</a></h1>
<p>This guide walks you through installing the Provisioning Platform on your system.</p>
<h2 id="overview"><a class="header" href="#overview">Overview</a></h2>
<p>The installation process involves:</p>
<ol>
<li>Cloning the repository</li>
<li>Installing Nushell plugins</li>
<li>Setting up configuration</li>
<li>Initializing your first workspace</li>
</ol>
<p>Estimated time: 15-20 minutes</p>
<h2 id="step-1-clone-the-repository"><a class="header" href="#step-1-clone-the-repository">Step 1: Clone the Repository</a></h2>
<pre><code class="language-bash"># Clone the repository
git clone https://github.com/provisioning/provisioning-platform.git
cd provisioning-platform
# Checkout the latest stable release (optional)
git checkout tags/v3.5.0
</code></pre>
<h2 id="step-2-install-nushell-plugins"><a class="header" href="#step-2-install-nushell-plugins">Step 2: Install Nushell Plugins</a></h2>
<p>The platform uses several Nushell plugins for enhanced functionality.</p>
<h3 id="install-nu_plugin_tera-template-rendering"><a class="header" href="#install-nu_plugin_tera-template-rendering">Install nu_plugin_tera (Template Rendering)</a></h3>
<pre><code class="language-bash"># Install from crates.io
cargo install nu_plugin_tera
# Register with Nushell
nu -c "plugin add ~/.cargo/bin/nu_plugin_tera; plugin use tera"
</code></pre>
<h3 id="install-nu_plugin_kcl-optional-kcl-integration"><a class="header" href="#install-nu_plugin_kcl-optional-kcl-integration">Install nu_plugin_kcl (Optional, KCL Integration)</a></h3>
<pre><code class="language-bash"># Install from custom repository
cargo install --git https://repo.jesusperez.pro/jesus/nushell-plugins nu_plugin_kcl
# Register with Nushell
nu -c "plugin add ~/.cargo/bin/nu_plugin_kcl; plugin use kcl"
</code></pre>
<h3 id="verify-plugin-installation"><a class="header" href="#verify-plugin-installation">Verify Plugin Installation</a></h3>
<pre><code class="language-bash"># Start Nushell
nu
# List installed plugins
plugin list
# Expected output should include:
# - tera
# - kcl (if installed)
</code></pre>
<h2 id="step-3-add-cli-to-path"><a class="header" href="#step-3-add-cli-to-path">Step 3: Add CLI to PATH</a></h2>
<p>Make the <code>provisioning</code> command available globally:</p>
<pre><code class="language-bash"># Option 1: Symlink to /usr/local/bin (recommended)
sudo ln -s "$(pwd)/provisioning/core/cli/provisioning" /usr/local/bin/provisioning
# Option 2: Add to PATH in your shell profile
echo 'export PATH="$PATH:'"$(pwd)"'/provisioning/core/cli"' &gt;&gt; ~/.bashrc # or ~/.zshrc
source ~/.bashrc # or ~/.zshrc
# Verify installation
provisioning --version
</code></pre>
<h2 id="step-4-generate-age-encryption-keys"><a class="header" href="#step-4-generate-age-encryption-keys">Step 4: Generate Age Encryption Keys</a></h2>
<p>Generate keys for encrypting sensitive configuration:</p>
<pre><code class="language-bash"># Create Age key directory
mkdir -p ~/.config/provisioning/age
# Generate private key
age-keygen -o ~/.config/provisioning/age/private_key.txt
# Extract public key
age-keygen -y ~/.config/provisioning/age/private_key.txt &gt; ~/.config/provisioning/age/public_key.txt
# Secure the keys
chmod 600 ~/.config/provisioning/age/private_key.txt
chmod 644 ~/.config/provisioning/age/public_key.txt
</code></pre>
<h2 id="step-5-configure-environment"><a class="header" href="#step-5-configure-environment">Step 5: Configure Environment</a></h2>
<p>Set up basic environment variables:</p>
<pre><code class="language-bash"># Create environment file
cat &gt; ~/.provisioning/env &lt;&lt; 'ENVEOF'
# Provisioning Environment Configuration
export PROVISIONING_ENV=dev
export PROVISIONING_PATH=$(pwd)
export PROVISIONING_KAGE=~/.config/provisioning/age
ENVEOF
# Source the environment
source ~/.provisioning/env
# Add to shell profile for persistence
echo 'source ~/.provisioning/env' &gt;&gt; ~/.bashrc # or ~/.zshrc
</code></pre>
<h2 id="step-6-initialize-workspace"><a class="header" href="#step-6-initialize-workspace">Step 6: Initialize Workspace</a></h2>
<p>Create your first workspace:</p>
<pre><code class="language-bash"># Initialize a new workspace
provisioning workspace init my-first-workspace
# Expected output:
# ✓ Workspace 'my-first-workspace' created successfully
# ✓ Configuration template generated
# ✓ Workspace activated
# Verify workspace
provisioning workspace list
</code></pre>
<h2 id="step-7-validate-installation"><a class="header" href="#step-7-validate-installation">Step 7: Validate Installation</a></h2>
<p>Run the installation verification:</p>
<pre><code class="language-bash"># Check system configuration
provisioning validate config
# Check all dependencies
provisioning env
# View detailed environment
provisioning allenv
</code></pre>
<p>Expected output should show:</p>
<ul>
<li>✅ All core dependencies installed</li>
<li>✅ Age keys configured</li>
<li>✅ Workspace initialized</li>
<li>✅ Configuration valid</li>
</ul>
<h2 id="optional-install-platform-services"><a class="header" href="#optional-install-platform-services">Optional: Install Platform Services</a></h2>
<p>If you plan to use platform services (orchestrator, control center, etc.):</p>
<pre><code class="language-bash"># Build platform services
cd provisioning/platform
# Build orchestrator
cd orchestrator
cargo build --release
cd ..
# Build control center
cd control-center
cargo build --release
cd ..
# Build KMS service
cd kms-service
cargo build --release
cd ..
# Verify builds
ls */target/release/
</code></pre>
<h2 id="optional-install-platform-with-installer"><a class="header" href="#optional-install-platform-with-installer">Optional: Install Platform with Installer</a></h2>
<p>Use the interactive installer for a guided setup:</p>
<pre><code class="language-bash"># Build the installer
cd provisioning/platform/installer
cargo build --release
# Run interactive installer
./target/release/provisioning-installer
# Or headless installation
./target/release/provisioning-installer --headless --mode solo --yes
</code></pre>
<h2 id="troubleshooting"><a class="header" href="#troubleshooting">Troubleshooting</a></h2>
<h3 id="nushell-plugin-not-found"><a class="header" href="#nushell-plugin-not-found">Nushell Plugin Not Found</a></h3>
<p>If plugins arent recognized:</p>
<pre><code class="language-bash"># Rebuild plugin registry
nu -c "plugin list; plugin use tera"
</code></pre>
<h3 id="permission-denied"><a class="header" href="#permission-denied">Permission Denied</a></h3>
<p>If you encounter permission errors:</p>
<pre><code class="language-bash"># Ensure proper ownership
sudo chown -R $USER:$USER ~/.config/provisioning
# Check PATH
echo $PATH | grep provisioning
</code></pre>
<h3 id="age-keys-not-found"><a class="header" href="#age-keys-not-found">Age Keys Not Found</a></h3>
<p>If encryption fails:</p>
<pre><code class="language-bash"># Verify keys exist
ls -la ~/.config/provisioning/age/
# Regenerate if needed
age-keygen -o ~/.config/provisioning/age/private_key.txt
</code></pre>
<h2 id="next-steps"><a class="header" href="#next-steps">Next Steps</a></h2>
<p>Once installation is complete, proceed to:
<strong><a href="03-first-deployment.html">First Deployment</a></strong></p>
<h2 id="additional-resources"><a class="header" href="#additional-resources">Additional Resources</a></h2>
<ul>
<li><a href="../user/installation-guide.html">Detailed Installation Guide</a></li>
<li><a href="../user/workspace-setup.html">Workspace Management</a></li>
<li><a href="../user/troubleshooting-guide.html">Troubleshooting Guide</a></li>
</ul>
</main>
<nav class="nav-wrapper" aria-label="Page navigation">
<!-- Mobile navigation buttons -->
<a rel="prev" href="../quickstart/01-prerequisites.html" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
<i class="fa fa-angle-left"></i>
</a>
<a rel="next prefetch" href="../quickstart/03-first-deployment.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
<i class="fa fa-angle-right"></i>
</a>
<div style="clear: both"></div>
</nav>
</div>
</div>
<nav class="nav-wide-wrapper" aria-label="Page navigation">
<a rel="prev" href="../quickstart/01-prerequisites.html" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
<i class="fa fa-angle-left"></i>
</a>
<a rel="next prefetch" href="../quickstart/03-first-deployment.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
<i class="fa fa-angle-right"></i>
</a>
</nav>
</div>
<!-- Livereload script (if served using the cli tool) -->
<script>
const wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
const wsAddress = wsProtocol + "//" + location.host + "/" + "__livereload";
const socket = new WebSocket(wsAddress);
socket.onmessage = function (event) {
if (event.data === "reload") {
socket.close();
location.reload();
}
};
window.onbeforeunload = function() {
socket.close();
}
</script>
<script>
window.playground_copyable = true;
</script>
<script src="../elasticlunr.min.js"></script>
<script src="../mark.min.js"></script>
<script src="../searcher.js"></script>
<script src="../clipboard.min.js"></script>
<script src="../highlight.js"></script>
<script src="../book.js"></script>
<!-- Custom JS scripts -->
</div>
</body>
</html>