970 lines
No EOL
39 KiB
HTML
970 lines
No EOL
39 KiB
HTML
|
||
<!DOCTYPE html>
|
||
|
||
|
||
<html lang="fr" data-content_root="../" >
|
||
|
||
<head>
|
||
<meta charset="utf-8" />
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
|
||
|
||
<title>Metadata et cloud-init — Documentation two 0.1.0</title>
|
||
|
||
|
||
|
||
<script data-cfasync="false">
|
||
document.documentElement.dataset.mode = localStorage.getItem("mode") || "";
|
||
document.documentElement.dataset.theme = localStorage.getItem("theme") || "";
|
||
</script>
|
||
<!--
|
||
this give us a css class that will be invisible only if js is disabled
|
||
-->
|
||
<noscript>
|
||
<style>
|
||
.pst-js-only { display: none !important; }
|
||
|
||
</style>
|
||
</noscript>
|
||
|
||
<!-- Loaded before other Sphinx assets -->
|
||
<link href="../_static/styles/theme.css?digest=8878045cc6db502f8baf" rel="stylesheet" />
|
||
<link href="../_static/styles/pydata-sphinx-theme.css?digest=8878045cc6db502f8baf" rel="stylesheet" />
|
||
|
||
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=8f2a1f02" />
|
||
<link rel="stylesheet" type="text/css" href="../_static/styles/sphinx-book-theme.css?v=3c74b3bc" />
|
||
|
||
<!-- So that users can add custom icons -->
|
||
<script src="../_static/scripts/fontawesome.js?digest=8878045cc6db502f8baf"></script>
|
||
<!-- Pre-loaded scripts that we'll load fully later -->
|
||
<link rel="preload" as="script" href="../_static/scripts/bootstrap.js?digest=8878045cc6db502f8baf" />
|
||
<link rel="preload" as="script" href="../_static/scripts/pydata-sphinx-theme.js?digest=8878045cc6db502f8baf" />
|
||
|
||
<script src="../_static/documentation_options.js?v=57395fb6"></script>
|
||
<script src="../_static/doctools.js?v=fd6eb6e6"></script>
|
||
<script src="../_static/sphinx_highlight.js?v=6ffebe34"></script>
|
||
<script src="../_static/scripts/sphinx-book-theme.js?v=fab101a9"></script>
|
||
<script src="../_static/translations.js?v=e6b791cb"></script>
|
||
<script src="https://cdn.jsdelivr.net/npm/d3@7.9.0/dist/d3.min.js"></script>
|
||
<script type="module">import mermaid from "https://cdn.jsdelivr.net/npm/mermaid@11.12.1/dist/mermaid.esm.min.mjs";
|
||
|
||
|
||
|
||
|
||
|
||
const initStyles = () => {
|
||
const defaultStyle = document.createElement('style');
|
||
defaultStyle.textContent = `pre.mermaid {
|
||
/* Same as .mermaid-container > pre */
|
||
display: block;
|
||
width: 100%;
|
||
}
|
||
|
||
pre.mermaid > svg {
|
||
/* Same as .mermaid-container > pre > svg */
|
||
height: 500px;
|
||
width: 100%;
|
||
max-width: 100% !important;
|
||
}`;
|
||
document.head.appendChild(defaultStyle);
|
||
|
||
const fullscreenStyle = document.createElement('style');
|
||
fullscreenStyle.textContent = `.mermaid-container {
|
||
display: flex;
|
||
flex-direction: row;
|
||
width: 100%;
|
||
}
|
||
|
||
.mermaid-container > pre {
|
||
display: block;
|
||
width: 100%;
|
||
}
|
||
|
||
.mermaid-container > pre > svg {
|
||
height: 500px;
|
||
width: 100%;
|
||
max-width: 100% !important;
|
||
}
|
||
|
||
.mermaid-fullscreen-btn {
|
||
width: 28px;
|
||
height: 28px;
|
||
background: rgba(255, 255, 255, 0.95);
|
||
border: 1px solid rgba(0, 0, 0, 0.3);
|
||
border-radius: 4px;
|
||
cursor: pointer;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
transition: all 0.2s;
|
||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
|
||
font-size: 14px;
|
||
line-height: 1;
|
||
padding: 0;
|
||
color: #333;
|
||
}
|
||
|
||
.mermaid-fullscreen-btn:hover {
|
||
opacity: 100% !important;
|
||
background: rgba(255, 255, 255, 1);
|
||
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
|
||
transform: scale(1.1);
|
||
}
|
||
|
||
.mermaid-fullscreen-btn.dark-theme {
|
||
background: rgba(50, 50, 50, 0.95);
|
||
border: 1px solid rgba(255, 255, 255, 0.3);
|
||
color: #e0e0e0;
|
||
}
|
||
|
||
.mermaid-fullscreen-btn.dark-theme:hover {
|
||
background: rgba(60, 60, 60, 1);
|
||
box-shadow: 0 3px 10px rgba(255, 255, 255, 0.2);
|
||
}
|
||
|
||
.mermaid-fullscreen-modal {
|
||
display: none;
|
||
position: fixed !important;
|
||
top: 0 !important;
|
||
left: 0 !important;
|
||
width: 95vw;
|
||
height: 100vh;
|
||
background: rgba(255, 255, 255, 0.98);
|
||
z-index: 9999;
|
||
padding: 20px;
|
||
overflow: auto;
|
||
}
|
||
|
||
.mermaid-fullscreen-modal.dark-theme {
|
||
background: rgba(0, 0, 0, 0.98);
|
||
}
|
||
|
||
.mermaid-fullscreen-modal.active {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
|
||
.mermaid-container-fullscreen {
|
||
position: relative;
|
||
width: 95vw;
|
||
height: 90vh;
|
||
max-width: 95vw;
|
||
max-height: 90vh;
|
||
background: white;
|
||
border-radius: 8px;
|
||
padding: 20px;
|
||
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
|
||
overflow: auto;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
|
||
.mermaid-container-fullscreen.dark-theme {
|
||
background: #1a1a1a;
|
||
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
|
||
}
|
||
|
||
.mermaid-container-fullscreen pre.mermaid {
|
||
width: 100%;
|
||
height: 100%;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
|
||
.mermaid-container-fullscreen .mermaid svg {
|
||
height: 100% !important;
|
||
width: 100% !important;
|
||
cursor: grab;
|
||
}
|
||
|
||
.mermaid-fullscreen-close {
|
||
position: fixed !important;
|
||
top: 20px !important;
|
||
right: 20px !important;
|
||
width: 40px;
|
||
height: 40px;
|
||
background: rgba(255, 255, 255, 0.95);
|
||
border: 1px solid rgba(0, 0, 0, 0.2);
|
||
border-radius: 50%;
|
||
cursor: pointer;
|
||
z-index: 10000;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
|
||
transition: all 0.2s;
|
||
font-size: 24px;
|
||
line-height: 1;
|
||
color: #333;
|
||
}
|
||
|
||
.mermaid-fullscreen-close:hover {
|
||
background: white;
|
||
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
|
||
transform: scale(1.1);
|
||
}
|
||
|
||
.mermaid-fullscreen-close.dark-theme {
|
||
background: rgba(50, 50, 50, 0.95);
|
||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||
color: #e0e0e0;
|
||
}
|
||
|
||
.mermaid-fullscreen-close.dark-theme:hover {
|
||
background: rgba(60, 60, 60, 1);
|
||
box-shadow: 0 6px 16px rgba(255, 255, 255, 0.2);
|
||
}
|
||
|
||
.mermaid-fullscreen-modal .mermaid-fullscreen-btn {
|
||
display: none !important;
|
||
}`;
|
||
document.head.appendChild(fullscreenStyle);
|
||
}
|
||
|
||
// Detect if page has dark background
|
||
const isDarkTheme = () => {
|
||
// We use a set of heuristics:
|
||
// 1. Check for common dark mode classes or attributes
|
||
// 2. Check computed background color brightness
|
||
if (document.documentElement.classList.contains('dark') ||
|
||
document.documentElement.getAttribute('data-theme') === 'dark' ||
|
||
document.body.classList.contains('dark') ||
|
||
document.body.getAttribute('data-theme') === 'dark') {
|
||
// console.log("Dark theme detected via class/attribute");
|
||
return true;
|
||
}
|
||
if (document.documentElement.classList.contains('light') ||
|
||
document.documentElement.getAttribute('data-theme') === 'light' ||
|
||
document.body.classList.contains('light') ||
|
||
document.body.getAttribute('data-theme') === 'light') {
|
||
// console.log("Light theme detected via class/attribute");
|
||
return false;
|
||
}
|
||
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
||
// console.log("Dark theme detected via prefers-color-scheme");
|
||
return true;
|
||
}
|
||
const bgColor = window.getComputedStyle(document.body).backgroundColor;
|
||
const match = bgColor.match(/rgb\((\d+),\s*(\d+),\s*(\d+)/);
|
||
if (match) {
|
||
const r = parseInt(match[1]);
|
||
const g = parseInt(match[2]);
|
||
const b = parseInt(match[3]);
|
||
const brightness = (r * 299 + g * 587 + b * 114) / 1000;
|
||
// console.log("Background color brightness:", brightness);
|
||
return brightness < 128;
|
||
}
|
||
// console.log("No dark or light theme detected, defaulting to light theme");
|
||
return false;
|
||
};
|
||
|
||
let darkTheme = isDarkTheme();
|
||
let modal = null;
|
||
let modalContent = null;
|
||
let previousScrollOffset = [window.scrollX, window.scrollY];
|
||
|
||
const runMermaid = async (rerun) => {
|
||
console.log("Running mermaid diagrams, rerun =", rerun);
|
||
// clear all existing mermaid charts
|
||
let all_mermaids = document.querySelectorAll(".mermaid");
|
||
|
||
if (rerun) {
|
||
all_mermaids.forEach((el) => {
|
||
if(!el.hasAttribute("data-original-code")) {
|
||
// store original code
|
||
// console.log(`Storing original code for first run: `, el.innerHTML);
|
||
el.setAttribute('data-original-code', el.innerHTML);
|
||
}
|
||
if(el.getAttribute("data-processed") === "true") {
|
||
// remove and restore original
|
||
el.removeAttribute("data-processed");
|
||
// console.log(`Restoring original code for re-run: `, el.getAttribute('data-original-code'));
|
||
el.innerHTML = el.getAttribute('data-original-code');
|
||
} else {
|
||
// store original code
|
||
// console.log(`Storing original code for re-run: `, el.innerHTML);
|
||
el.setAttribute('data-original-code', el.innerHTML);
|
||
}
|
||
});
|
||
await mermaid.run();
|
||
}
|
||
|
||
all_mermaids = document.querySelectorAll(".mermaid");
|
||
const mermaids_processed = document.querySelectorAll(".mermaid[data-processed='true']");
|
||
|
||
if ("False" === "True") {
|
||
const mermaids_to_add_zoom = -1 === -1 ? all_mermaids.length : -1;
|
||
if(mermaids_to_add_zoom > 0) {
|
||
var svgs = d3.selectAll("");
|
||
if(all_mermaids.length !== mermaids_processed.length) {
|
||
setTimeout(() => runMermaid(false), 200);
|
||
return;
|
||
} else if(svgs.size() !== mermaids_to_add_zoom) {
|
||
setTimeout(() => runMermaid(false), 200);
|
||
return;
|
||
} else {
|
||
svgs.each(function() {
|
||
var svg = d3.select(this);
|
||
svg.html("<g class='wrapper'>" + svg.html() + "</g>");
|
||
var inner = svg.select("g");
|
||
var zoom = d3.zoom().on("zoom", function(event) {
|
||
inner.attr("transform", event.transform);
|
||
});
|
||
svg.call(zoom);
|
||
});
|
||
}
|
||
}
|
||
} else if(all_mermaids.length !== mermaids_processed.length) {
|
||
// Wait for mermaid to process all diagrams
|
||
setTimeout(() => runMermaid(false), 200);
|
||
return;
|
||
}
|
||
|
||
// Stop here if not adding fullscreen capability
|
||
if ("True" !== "True") return;
|
||
|
||
if (modal !== null ) {
|
||
// Destroy existing modal
|
||
modal.remove();
|
||
modal = null;
|
||
modalContent = null;
|
||
}
|
||
|
||
modal = document.createElement('div');
|
||
modal.className = 'mermaid-fullscreen-modal' + (darkTheme ? ' dark-theme' : '');
|
||
modal.setAttribute('role', 'dialog');
|
||
modal.setAttribute('aria-modal', 'true');
|
||
modal.setAttribute('aria-label', 'Fullscreen diagram viewer');
|
||
modal.innerHTML = `
|
||
<button class="mermaid-fullscreen-close${darkTheme ? ' dark-theme' : ''}" aria-label="Close fullscreen">✕</button>
|
||
<div class="mermaid-container-fullscreen${darkTheme ? ' dark-theme' : ''}"></div>
|
||
`;
|
||
document.body.appendChild(modal);
|
||
|
||
modalContent = modal.querySelector('.mermaid-container-fullscreen');
|
||
const closeBtn = modal.querySelector('.mermaid-fullscreen-close');
|
||
|
||
const closeModal = () => {
|
||
modal.classList.remove('active');
|
||
modalContent.innerHTML = '';
|
||
document.body.style.overflow = ''
|
||
window.scrollTo({left: previousScrollOffset[0], top: previousScrollOffset[1], behavior: 'instant'});
|
||
};
|
||
|
||
closeBtn.addEventListener('click', closeModal);
|
||
modal.addEventListener('click', (e) => {
|
||
if (e.target === modal) closeModal();
|
||
});
|
||
document.addEventListener('keydown', (e) => {
|
||
if (e.key === 'Escape' && modal.classList.contains('active')) {
|
||
closeModal();
|
||
}
|
||
});
|
||
|
||
document.querySelectorAll('.mermaid').forEach((mermaidDiv) => {
|
||
if (mermaidDiv.parentNode.classList.contains('mermaid-container') ||
|
||
mermaidDiv.closest('.mermaid-fullscreen-modal')) {
|
||
// Already processed, adjust button class if needed
|
||
const existingBtn = mermaidDiv.parentNode.querySelector('.mermaid-fullscreen-btn');
|
||
if (existingBtn) {
|
||
existingBtn.className = 'mermaid-fullscreen-btn' + (darkTheme ? ' dark-theme' : '');
|
||
}
|
||
return;
|
||
}
|
||
|
||
const container = document.createElement('div');
|
||
container.className = 'mermaid-container';
|
||
mermaidDiv.parentNode.insertBefore(container, mermaidDiv);
|
||
container.appendChild(mermaidDiv);
|
||
|
||
const fullscreenBtn = document.createElement('button');
|
||
fullscreenBtn.className = 'mermaid-fullscreen-btn' + (darkTheme ? ' dark-theme' : '');
|
||
fullscreenBtn.setAttribute('aria-label', 'View diagram in fullscreen');
|
||
fullscreenBtn.textContent = '⛶';
|
||
fullscreenBtn.style.opacity = '50%';
|
||
|
||
// Calculate dynamic position based on diagram's margin and padding
|
||
const diagramStyle = window.getComputedStyle(mermaidDiv);
|
||
const marginTop = parseFloat(diagramStyle.marginTop) || 0;
|
||
const marginRight = parseFloat(diagramStyle.marginRight) || 0;
|
||
const paddingTop = parseFloat(diagramStyle.paddingTop) || 0;
|
||
const paddingRight = parseFloat(diagramStyle.paddingRight) || 0;
|
||
fullscreenBtn.style.top = `${marginTop + paddingTop + 4}px`;
|
||
fullscreenBtn.style.right = `${marginRight + paddingRight + 4}px`;
|
||
|
||
fullscreenBtn.addEventListener('click', () => {
|
||
previousScrollOffset = [window.scroll, window.scrollY];
|
||
const clone = mermaidDiv.cloneNode(true);
|
||
modalContent.innerHTML = '';
|
||
modalContent.appendChild(clone);
|
||
|
||
const svg = clone.querySelector('svg');
|
||
if (svg) {
|
||
svg.removeAttribute('width');
|
||
svg.removeAttribute('height');
|
||
svg.style.width = '100%';
|
||
svg.style.height = 'auto';
|
||
svg.style.maxWidth = '100%';
|
||
svg.style.sdisplay = 'block';
|
||
|
||
if ("False" === "True") {
|
||
setTimeout(() => {
|
||
const g = svg.querySelector('g');
|
||
if (g) {
|
||
var svgD3 = d3.select(svg);
|
||
svgD3.html("<g class='wrapper'>" + svgD3.html() + "</g>");
|
||
var inner = svgD3.select("g");
|
||
var zoom = d3.zoom().on("zoom", function(event) {
|
||
inner.attr("transform", event.transform);
|
||
});
|
||
svgD3.call(zoom);
|
||
}
|
||
}, 100);
|
||
}
|
||
}
|
||
|
||
modal.classList.add('active');
|
||
document.body.style.overflow = 'hidden';
|
||
});
|
||
container.appendChild(fullscreenBtn);
|
||
});
|
||
};
|
||
|
||
const load = async () => {
|
||
initStyles();
|
||
|
||
await runMermaid(true);
|
||
|
||
const reRunIfThemeChanges = async () => {
|
||
const newDarkTheme = isDarkTheme();
|
||
if (newDarkTheme !== darkTheme) {
|
||
darkTheme = newDarkTheme;
|
||
console.log("Theme change detected, re-running mermaid with", darkTheme ? "dark" : "default", "theme");
|
||
await mermaid.initialize(
|
||
{...JSON.parse(
|
||
`{"startOnLoad": false}`
|
||
),
|
||
...{ darkMode: darkTheme, theme: darkTheme ? 'dark' : 'default' },
|
||
}
|
||
);
|
||
await runMermaid(true);
|
||
}
|
||
};
|
||
|
||
// Update theme classes when theme changes
|
||
const themeObserver = new MutationObserver(reRunIfThemeChanges);
|
||
themeObserver.observe(document.documentElement, {
|
||
attributes: true,
|
||
attributeFilter: ['class', 'style', 'data-theme']
|
||
});
|
||
themeObserver.observe(document.body, {
|
||
attributes: true,
|
||
attributeFilter: ['class', 'style', 'data-theme']
|
||
});
|
||
};
|
||
|
||
|
||
|
||
|
||
|
||
console.log("Initializing mermaid with", darkTheme ? "dark" : "default", "theme");
|
||
mermaid.initialize(
|
||
{...JSON.parse(
|
||
`{"startOnLoad": false}`
|
||
),
|
||
...{ darkMode: darkTheme, theme: darkTheme ? 'dark' : 'default' },
|
||
}
|
||
);
|
||
|
||
window.addEventListener("load", load);
|
||
window.runMermaid = runMermaid;</script>
|
||
<script>DOCUMENTATION_OPTIONS.pagename = 'concepts/metadata-cloud-init';</script>
|
||
<script>
|
||
DOCUMENTATION_OPTIONS.theme_version = '0.16.1';
|
||
DOCUMENTATION_OPTIONS.theme_switcher_json_url = '../switcher.json';
|
||
DOCUMENTATION_OPTIONS.theme_switcher_version_match = 'main';
|
||
DOCUMENTATION_OPTIONS.show_version_warning_banner =
|
||
false;
|
||
</script>
|
||
<link rel="index" title="Index" href="../genindex.html" />
|
||
<link rel="search" title="Recherche" href="../search.html" />
|
||
<link rel="next" title="Architecture" href="../architecture/index.html" />
|
||
<link rel="prev" title="Cycle de vie des ressources" href="cycle-de-vie.html" />
|
||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||
<meta name="docsearch:language" content="fr"/>
|
||
<meta name="docsearch:version" content="0.1" />
|
||
</head>
|
||
|
||
|
||
<body data-bs-spy="scroll" data-bs-target=".bd-toc-nav" data-offset="180" data-bs-root-margin="0px 0px -60%" data-default-mode="">
|
||
|
||
|
||
|
||
<div id="pst-skip-link" class="skip-link d-print-none"><a href="#main-content">Passer au contenu principal</a></div>
|
||
|
||
<div id="pst-scroll-pixel-helper"></div>
|
||
|
||
<button type="button" class="btn rounded-pill" id="pst-back-to-top">
|
||
<i class="fa-solid fa-arrow-up"></i>Haut de page</button>
|
||
|
||
|
||
<dialog id="pst-search-dialog">
|
||
|
||
<form class="bd-search d-flex align-items-center"
|
||
action="../search.html"
|
||
method="get">
|
||
<i class="fa-solid fa-magnifying-glass"></i>
|
||
<input type="search"
|
||
class="form-control"
|
||
name="q"
|
||
placeholder="Search..."
|
||
aria-label="Search..."
|
||
autocomplete="off"
|
||
autocorrect="off"
|
||
autocapitalize="off"
|
||
spellcheck="false"/>
|
||
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd>K</kbd></span>
|
||
</form>
|
||
</dialog>
|
||
|
||
<div class="pst-async-banner-revealer d-none">
|
||
<aside id="bd-header-version-warning" class="d-none d-print-none" aria-label="Alerte de version"></aside>
|
||
</div>
|
||
|
||
|
||
<header class="bd-header navbar navbar-expand-lg bd-navbar d-print-none">
|
||
</header>
|
||
|
||
|
||
<div class="bd-container">
|
||
<div class="bd-container__inner bd-page-width">
|
||
|
||
|
||
|
||
<dialog id="pst-primary-sidebar-modal"></dialog>
|
||
<div id="pst-primary-sidebar" class="bd-sidebar-primary bd-sidebar">
|
||
|
||
|
||
|
||
<div class="sidebar-header-items sidebar-primary__section">
|
||
|
||
|
||
|
||
|
||
</div>
|
||
|
||
<div class="sidebar-primary-items__start sidebar-primary__section">
|
||
<div class="sidebar-primary-item">
|
||
|
||
|
||
|
||
|
||
|
||
<a class="navbar-brand logo" href="../index.html">
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<p class="title logo__title">Documentation two 0.1.0</p>
|
||
|
||
</a></div>
|
||
<div class="sidebar-primary-item"><ul class="navbar-icon-links"
|
||
aria-label="Icon Links">
|
||
<li class="nav-item">
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<a href="https://git.g3e.fr/syonad/two" title="Dépôt" class="nav-link pst-navbar-icon" rel="noopener" target="_blank" data-bs-toggle="tooltip" data-bs-placement="bottom"><i class="fa-solid fa-code-branch fa-lg" aria-hidden="true"></i>
|
||
<span class="sr-only">Dépôt</span></a>
|
||
</li>
|
||
</ul></div>
|
||
<div class="sidebar-primary-item">
|
||
<div class="version-switcher__container dropdown pst-js-only">
|
||
<button id="pst-version-switcher-button-2"
|
||
type="button"
|
||
class="version-switcher__button btn btn-sm dropdown-toggle"
|
||
data-bs-toggle="dropdown"
|
||
aria-haspopup="listbox"
|
||
aria-controls="pst-version-switcher-list-2"
|
||
aria-label="Version switcher list"
|
||
>
|
||
Choose version <!-- this text may get changed later by javascript -->
|
||
<span class="caret"></span>
|
||
</button>
|
||
<div id="pst-version-switcher-list-2"
|
||
class="version-switcher__menu dropdown-menu list-group-flush py-0"
|
||
role="listbox" aria-labelledby="pst-version-switcher-button-2">
|
||
<!-- dropdown will be populated by javascript on page load -->
|
||
</div>
|
||
</div></div>
|
||
<div class="sidebar-primary-item">
|
||
|
||
<button class="btn search-button-field search-button__button pst-js-only" title="Recherche" aria-label="Recherche" data-bs-placement="bottom" data-bs-toggle="tooltip">
|
||
<i class="fa-solid fa-magnifying-glass"></i>
|
||
<span class="search-button__default-text">Recherche</span>
|
||
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd class="kbd-shortcut__modifier">K</kbd></span>
|
||
</button></div>
|
||
<div class="sidebar-primary-item"><nav class="bd-links bd-docs-nav" aria-label="Main">
|
||
<div class="bd-toc-item navbar-nav active">
|
||
|
||
<ul class="nav bd-sidenav bd-sidenav__home-link">
|
||
<li class="toctree-l1">
|
||
<a class="reference internal" href="../index.html">
|
||
two
|
||
</a>
|
||
</li>
|
||
</ul>
|
||
<p aria-level="2" class="caption" role="heading"><span class="caption-text">Mise en œuvre</span></p>
|
||
<ul class="nav bd-sidenav">
|
||
<li class="toctree-l1 has-children"><a class="reference internal" href="../demarrage/index.html">Démarrage</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
|
||
<li class="toctree-l2"><a class="reference internal" href="../demarrage/installation.html">Installation d’un hyperviseur</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="../demarrage/premier-vpc.html">Premier VPC, premier subnet, première VM</a></li>
|
||
</ul>
|
||
</details></li>
|
||
<li class="toctree-l1 has-children"><a class="reference internal" href="../deploiement/index.html">Déploiement d’un cluster</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
|
||
<li class="toctree-l2"><a class="reference internal" href="../deploiement/architecture-cluster.html">Architecture du cluster</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="../deploiement/image-qcow2.html">Construction de l’image qcow2</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="../deploiement/routeurs.html">Routeurs</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="../deploiement/premier-hyperviseur.html">Premier hyperviseur</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="../deploiement/route-reflector.html">VM route reflector</a></li>
|
||
</ul>
|
||
</details></li>
|
||
</ul>
|
||
<p aria-level="2" class="caption" role="heading"><span class="caption-text">Exploitation</span></p>
|
||
<ul class="nav bd-sidenav">
|
||
<li class="toctree-l1 has-children"><a class="reference internal" href="../exploitation/index.html">Exploitation</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
|
||
<li class="toctree-l2"><a class="reference internal" href="../exploitation/configuration.html">Configuration</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="../exploitation/services.html">Services systemd</a></li>
|
||
<li class="toctree-l2 has-children"><a class="reference internal" href="../exploitation/api-agent/index.html">API de l’agent</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
|
||
<li class="toctree-l3"><a class="reference internal" href="../exploitation/api-agent/asynchronisme.html">Modèle asynchrone et codes de retour</a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="../exploitation/api-agent/reference.html">Référence</a></li>
|
||
</ul>
|
||
</details></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="../exploitation/observabilite.html">Observabilité</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="../exploitation/diagnostic.html">Diagnostic</a></li>
|
||
</ul>
|
||
</details></li>
|
||
</ul>
|
||
<p aria-level="2" class="caption" role="heading"><span class="caption-text">Développement</span></p>
|
||
<ul class="nav bd-sidenav">
|
||
<li class="toctree-l1 has-children"><a class="reference internal" href="../developpement/index.html">Développement</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
|
||
<li class="toctree-l2"><a class="reference internal" href="../developpement/lab.html">Lab de test multi-nœud</a></li>
|
||
</ul>
|
||
</details></li>
|
||
</ul>
|
||
<p aria-level="2" class="caption" role="heading"><span class="caption-text">Interne</span></p>
|
||
<ul class="current nav bd-sidenav">
|
||
<li class="toctree-l1 current active has-children"><a class="reference internal" href="index.html">Concepts</a><details open="open"><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul class="current">
|
||
<li class="toctree-l2"><a class="reference internal" href="vpc-subnet-vm.html">VPC, subnet et VM</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="modes-reseau.html">Modes réseau</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="cycle-de-vie.html">Cycle de vie des ressources</a></li>
|
||
<li class="toctree-l2 current active"><a class="current reference internal" href="#">Metadata et cloud-init</a></li>
|
||
</ul>
|
||
</details></li>
|
||
<li class="toctree-l1 has-children"><a class="reference internal" href="../architecture/index.html">Architecture</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
|
||
<li class="toctree-l2"><a class="reference internal" href="../architecture/vue-densemble.html">Vue d’ensemble</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="../architecture/stockage.html">Schéma des clés</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="../architecture/contraintes.html">Invariants et pièges</a></li>
|
||
</ul>
|
||
</details></li>
|
||
<li class="toctree-l1 has-children"><a class="reference internal" href="../versions/index.html">Versions</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
|
||
<li class="toctree-l2"><a class="reference internal" href="../versions/0.2.0.html">Bael</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="../versions/0.1.0.html">Michael</a></li>
|
||
</ul>
|
||
</details></li>
|
||
</ul>
|
||
|
||
</div>
|
||
</nav></div>
|
||
</div>
|
||
|
||
|
||
<div class="sidebar-primary-items__end sidebar-primary__section">
|
||
<div class="sidebar-primary-item">
|
||
<div id="ethical-ad-placement"
|
||
class="flat"
|
||
data-ea-publisher="readthedocs"
|
||
data-ea-type="readthedocs-sidebar"
|
||
data-ea-manual="true">
|
||
</div></div>
|
||
</div>
|
||
|
||
|
||
</div>
|
||
|
||
<main id="main-content" class="bd-main" role="main">
|
||
|
||
|
||
|
||
<div class="sbt-scroll-pixel-helper"></div>
|
||
|
||
<div class="bd-content">
|
||
<div class="bd-article-container">
|
||
|
||
<div class="bd-header-article d-print-none">
|
||
<div class="header-article-items header-article__inner">
|
||
|
||
<div class="header-article-items__start">
|
||
|
||
<div class="header-article-item"><button class="sidebar-toggle primary-toggle btn btn-sm" title="Toggle primary sidebar" data-bs-placement="bottom" data-bs-toggle="tooltip">
|
||
<span class="fa-solid fa-bars"></span>
|
||
</button></div>
|
||
|
||
</div>
|
||
|
||
|
||
<div class="header-article-items__end">
|
||
|
||
<div class="header-article-item">
|
||
|
||
<div class="article-header-buttons">
|
||
|
||
|
||
|
||
<button onclick="toggleFullScreen()"
|
||
class="btn btn-sm btn-fullscreen-button pst-navbar-icon"
|
||
title="Mode plein écran"
|
||
data-bs-placement="bottom" data-bs-toggle="tooltip"
|
||
>
|
||
|
||
|
||
<span class="btn__icon-container">
|
||
<i class="fas fa-expand"></i>
|
||
</span>
|
||
|
||
</button>
|
||
|
||
|
||
|
||
<button class="btn btn-sm nav-link pst-navbar-icon theme-switch-button pst-js-only" aria-label="Thème" data-bs-title="Thème" data-bs-placement="bottom" data-bs-toggle="tooltip">
|
||
<i class="theme-switch fa-solid fa-sun fa-lg" data-mode="light" title="Clair"></i>
|
||
<i class="theme-switch fa-solid fa-moon fa-lg" data-mode="dark" title="Sombre"></i>
|
||
<i class="theme-switch fa-solid fa-circle-half-stroke fa-lg" data-mode="auto" title="Paramètres système"></i>
|
||
</button>
|
||
|
||
|
||
<button class="btn btn-sm pst-navbar-icon search-button search-button__button pst-js-only" title="Recherche" aria-label="Recherche" data-bs-placement="bottom" data-bs-toggle="tooltip">
|
||
<i class="fa-solid fa-magnifying-glass fa-lg"></i>
|
||
</button>
|
||
<button class="sidebar-toggle secondary-toggle btn btn-sm pst-navbar-icon" title="Toggle secondary sidebar" data-bs-placement="bottom" data-bs-toggle="tooltip">
|
||
<span class="fa-solid fa-list"></span>
|
||
</button>
|
||
</div></div>
|
||
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
|
||
|
||
<div id="jb-print-docs-body" class="onlyprint">
|
||
<h1>Metadata et cloud-init</h1>
|
||
<!-- Table of contents -->
|
||
<div id="print-main-content">
|
||
<div id="jb-print-toc">
|
||
|
||
<div>
|
||
<h2> Contenu </h2>
|
||
</div>
|
||
<nav aria-label="Page">
|
||
<ul class="visible nav section-nav flex-column">
|
||
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#chaine-de-production">Chaîne de production</a></li>
|
||
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#documents-servis">Documents servis</a></li>
|
||
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#champs-de-metadata">Champs de <code class="docutils literal notranslate"><span class="pre">metadata</span></code></a></li>
|
||
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#instance-id"><code class="docutils literal notranslate"><span class="pre">instance-id</span></code></a></li>
|
||
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#configuration-reseau">Configuration réseau</a></li>
|
||
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#securite">Sécurité</a></li>
|
||
</ul>
|
||
</nav>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
|
||
<div id="searchbox"></div>
|
||
<article class="bd-article">
|
||
|
||
<section id="metadata-et-cloud-init">
|
||
<h1>Metadata et cloud-init<a class="headerlink" href="#metadata-et-cloud-init" title="Lien vers cette rubrique">#</a></h1>
|
||
<p>Chaque VM dispose d’un serveur de metadata NoCloud, servi sur <code class="docutils literal notranslate"><span class="pre">169.254.169.254</span></code> dans le netns
|
||
de son VPC, sous la forme d’une instance systemd <code class="docutils literal notranslate"><span class="pre">metadata@<vm></span></code>.</p>
|
||
<section id="chaine-de-production">
|
||
<h2>Chaîne de production<a class="headerlink" href="#chaine-de-production" title="Lien vers cette rubrique">#</a></h2>
|
||
<pre class="mermaid">
|
||
graph LR
|
||
A["agent<br/>WriteNoCloudFiles"] -->|"/run/two/metadata/&lt;vm&gt;/"| M["binaire metadata"]
|
||
M -->|HTTP 169.254.169.254| G["guest<br/>cloud-init"]
|
||
</pre><p>L’agent écrit les fichiers cloud-init sur disque <strong>avant</strong> de démarrer le service ; le binaire
|
||
<code class="docutils literal notranslate"><span class="pre">metadata</span></code> les lit et les sert. Le processus <code class="docutils literal notranslate"><span class="pre">metadata</span></code> n’ouvre <strong>jamais</strong> la base Badger :
|
||
deux processus ne doivent pas partager une même instance.</p>
|
||
</section>
|
||
<section id="documents-servis">
|
||
<h2>Documents servis<a class="headerlink" href="#documents-servis" title="Lien vers cette rubrique">#</a></h2>
|
||
<p>Chaque document suit la même règle :</p>
|
||
<ul class="simple">
|
||
<li><p>fourni par l’appelant → servi <strong>verbatim</strong>, l’agent n’interprète rien ;</p></li>
|
||
<li><p>absent → le template par défaut est rendu ;</p></li>
|
||
<li><p>fourni <strong>vide</strong> → servi vide.</p></li>
|
||
</ul>
|
||
<p>Les deux derniers cas sont distincts, et c’est délibéré : fournir une chaîne vide est une façon
|
||
explicite de neutraliser un document.</p>
|
||
</section>
|
||
<section id="champs-de-metadata">
|
||
<h2>Champs de <code class="docutils literal notranslate"><span class="pre">metadata</span></code><a class="headerlink" href="#champs-de-metadata" title="Lien vers cette rubrique">#</a></h2>
|
||
<dl class="simple">
|
||
<dt><code class="docutils literal notranslate"><span class="pre">sshkey</span></code></dt><dd><p>Clé publique ajoutée au compte <code class="docutils literal notranslate"><span class="pre">syonad</span></code>. Transmise telle quelle, non encodée.</p>
|
||
</dd>
|
||
<dt><code class="docutils literal notranslate"><span class="pre">password</span></code></dt><dd><p>Un <strong>hash</strong>, tel qu’attendu par la clé <code class="docutils literal notranslate"><span class="pre">passwd</span></code> de cloud-config (<code class="docutils literal notranslate"><span class="pre">$6$…</span></code>) — jamais un mot
|
||
de passe en clair. Omis, le compte est créé verrouillé ; sans <code class="docutils literal notranslate"><span class="pre">password</span></code> ni <code class="docutils literal notranslate"><span class="pre">sshkey</span></code>,
|
||
aucun compte n’est créé.</p>
|
||
</dd>
|
||
<dt><code class="docutils literal notranslate"><span class="pre">user_data</span></code></dt><dd><p>Le user-data cloud-init, <strong>encodé en base64</strong>. L’encodage évite l’échappement JSON des
|
||
documents multi-lignes et autorise les charges <code class="docutils literal notranslate"><span class="pre">gzip+base64</span></code>. Un base64 invalide est rejeté
|
||
en 400 plutôt que servi vide.</p>
|
||
</dd>
|
||
</dl>
|
||
</section>
|
||
<section id="instance-id">
|
||
<h2><code class="docutils literal notranslate"><span class="pre">instance-id</span></code><a class="headerlink" href="#instance-id" title="Lien vers cette rubrique">#</a></h2>
|
||
<p><code class="docutils literal notranslate"><span class="pre">instance-id</span></code> vaut le <strong>nom de la VM</strong>. Recréer une VM du même nom sur le même disque fait que
|
||
cloud-init la reconnaît comme déjà provisionnée et <strong>n’applique pas</strong> le user-data. Pour rejouer
|
||
un provisionnement : changer de nom, repartir d’un disque neuf, ou exécuter
|
||
<code class="docutils literal notranslate"><span class="pre">cloud-init</span> <span class="pre">clean</span> <span class="pre">--logs</span></code> dans le guest avant l’extinction.</p>
|
||
</section>
|
||
<section id="configuration-reseau">
|
||
<h2>Configuration réseau<a class="headerlink" href="#configuration-reseau" title="Lien vers cette rubrique">#</a></h2>
|
||
<div class="admonition warning">
|
||
<p class="admonition-title">Avertissement</p>
|
||
<p><code class="docutils literal notranslate"><span class="pre">network-config.tmpl</span></code> cible <code class="docutils literal notranslate"><span class="pre">eth0</span></code> alors que les guests utilisent <code class="docutils literal notranslate"><span class="pre">ens3</span></code> : il ne
|
||
s’applique donc à rien, et le réseau des VM vient du DHCP. <strong>Ne pas le « corriger » ni le
|
||
supprimer.</strong> Le rendre opérant ferait remplacer par cloud-init la configuration réseau de
|
||
l’image, sur toutes les VM.</p>
|
||
</div>
|
||
</section>
|
||
<section id="securite">
|
||
<h2>Sécurité<a class="headerlink" href="#securite" title="Lien vers cette rubrique">#</a></h2>
|
||
<p><code class="docutils literal notranslate"><span class="pre">/run/two/metadata/<vm>/vendor-data</span></code> est en <code class="docutils literal notranslate"><span class="pre">0644</span></code> et contient le hash de mot de passe. Tout
|
||
compte local du host peut le lire. C’est une exposition connue et acceptée en l’état ; elle
|
||
disqualifie l’usage de hashs faibles ou réutilisés.</p>
|
||
</section>
|
||
</section>
|
||
|
||
|
||
</article>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<footer class="prev-next-footer d-print-none">
|
||
|
||
<div class="prev-next-area">
|
||
<a class="left-prev"
|
||
href="cycle-de-vie.html"
|
||
title="page précédente">
|
||
<i class="fa-solid fa-angle-left"></i>
|
||
<div class="prev-next-info">
|
||
<p class="prev-next-subtitle">précédent</p>
|
||
<p class="prev-next-title">Cycle de vie des ressources</p>
|
||
</div>
|
||
</a>
|
||
<a class="right-next"
|
||
href="../architecture/index.html"
|
||
title="page suivante">
|
||
<div class="prev-next-info">
|
||
<p class="prev-next-subtitle">suivant</p>
|
||
<p class="prev-next-title">Architecture</p>
|
||
</div>
|
||
<i class="fa-solid fa-angle-right"></i>
|
||
</a>
|
||
</div>
|
||
</footer>
|
||
|
||
</div>
|
||
|
||
|
||
|
||
<dialog id="pst-secondary-sidebar-modal"></dialog>
|
||
<div id="pst-secondary-sidebar" class="bd-sidebar-secondary bd-toc"><div class="sidebar-secondary-items sidebar-secondary__inner">
|
||
|
||
|
||
<div class="sidebar-secondary-item"><div
|
||
id="pst-page-navigation-heading-2"
|
||
class="page-toc tocsection onthispage">
|
||
<i class="fa-solid fa-list"></i> Contenu
|
||
</div>
|
||
<nav id="pst-page-toc-nav" class="page-toc" aria-labelledby="pst-page-navigation-heading-2">
|
||
<ul class="visible nav section-nav flex-column">
|
||
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#chaine-de-production">Chaîne de production</a></li>
|
||
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#documents-servis">Documents servis</a></li>
|
||
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#champs-de-metadata">Champs de <code class="docutils literal notranslate"><span class="pre">metadata</span></code></a></li>
|
||
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#instance-id"><code class="docutils literal notranslate"><span class="pre">instance-id</span></code></a></li>
|
||
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#configuration-reseau">Configuration réseau</a></li>
|
||
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#securite">Sécurité</a></li>
|
||
</ul>
|
||
</nav></div>
|
||
|
||
</div></div>
|
||
|
||
|
||
</div>
|
||
<footer class="bd-footer-content">
|
||
|
||
<div class="bd-footer-content__inner container">
|
||
|
||
<div class="footer-item">
|
||
|
||
<p class="component-author">
|
||
Par Nicolas Boufidjeline
|
||
</p>
|
||
|
||
</div>
|
||
|
||
<div class="footer-item">
|
||
|
||
|
||
<p class="copyright">
|
||
|
||
© Copyright 2026, Nicolas Boufidjeline.
|
||
<br/>
|
||
|
||
</p>
|
||
|
||
</div>
|
||
|
||
<div class="footer-item">
|
||
|
||
</div>
|
||
|
||
<div class="footer-item">
|
||
|
||
</div>
|
||
|
||
</div>
|
||
</footer>
|
||
|
||
|
||
</main>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Scripts loaded after <body> so the DOM is not blocked -->
|
||
<script defer src="../_static/scripts/bootstrap.js?digest=8878045cc6db502f8baf"></script>
|
||
<script defer src="../_static/scripts/pydata-sphinx-theme.js?digest=8878045cc6db502f8baf"></script>
|
||
|
||
<footer class="bd-footer">
|
||
</footer>
|
||
</body>
|
||
</html> |