docs: add Ansible inventory slide (static vs dynamic) + Jinja2 notes

- new slide 26: inventory construction — static YAML vs dynamic
  OpenStack plugin, with side-by-side examples and notes
- renumber subsequent slide markers 26-40 -> 27-41 (now 41 slides)
- slide 25: add Jinja2 templating speaker notes

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Arnaud Prémel-Cabic
2026-06-08 11:22:25 +02:00
parent b1dab6fde4
commit e893e39871

View File

@@ -1035,11 +1035,52 @@ Apply complete! Resources: 2 added, 0 changed, 0 destroyed.
<li>Plain YAML — tasks run top to bottom against the "webservers" group.</li>
<li>become: true = run as root (sudo).</li>
<li>Handlers are the neat bit: restart nginx only if the config actually changed.</li>
<li>The <code>.j2</code> in <code>nginx.conf.j2</code> = Jinja2, Ansible's templating engine. The template module renders it on the control node — <code>{{ variables }}</code>, <code>{% if %}</code>/<code>{% for %}</code> logic, filters like <code>{{ value | default(...) }}</code> — then ships the result to <code>dest</code>.</li>
<li>That's how one template serves many hosts: same file, per-host values from inventory/group_vars.</li>
</ul>
</aside>
</section>
<!-- ─── SLIDE 26 : Ansible CLI ──────────────────────────────────── -->
<!-- ─── SLIDE 26 : Ansible inventory ────────────────────────────── -->
<section class="s-ansible">
<h2 style="font-size:1.05em;">Who runs where? The inventory.</h2>
<ul style="font-size:0.9em;">
<li><strong>Static</strong> — a hand-written INI/YAML file of hosts &amp; groups. Simple, versioned, ideal for stable fleets.</li>
<li><strong>Dynamic</strong> — an inventory plugin queries a source at runtime (OpenStack, AWS, OVHcloud…). Hosts discovered automatically — built for cloud &amp; autoscaling.</li>
</ul>
<div style="display:flex; gap:1.5em; margin-top:0.3em; text-align:left;">
<div style="flex:1;">
<p class="filename"># inventory.yml — static</p>
<pre><code class="language-yaml" data-trim>
webservers:
hosts:
web-01:
ansible_host: 10.0.0.11
web-02:
ansible_host: 10.0.0.12
</code></pre>
</div>
<div style="flex:1;">
<p class="filename"># openstack.yml — dynamic</p>
<pre><code class="language-yaml" data-trim>
plugin: openstack.cloud.openstack
expand_hostvars: true
groups:
webservers: "'web' in name"
</code></pre>
</div>
</div>
<aside class="notes">
<ul>
<li>The <code>-i</code> flag on the next slide points here — Ansible needs to know which hosts to target.</li>
<li><strong>Static</strong>: explicit list checked into Git. Predictable, but you maintain it by hand.</li>
<li><strong>Dynamic</strong>: the plugin runs at playbook time and queries the cloud API, so hosts auto-appear/disappear with the fleet. <code>groups</code>/<code>keyed_groups</code> build groups from tags or metadata.</li>
<li><code>-i</code> accepts a static file, a directory (mixing several sources), or a plugin config like the one on the right.</li>
</ul>
</aside>
</section>
<!-- ─── SLIDE 27 : Ansible CLI ──────────────────────────────────── -->
<section class="s-ansible">
<p class="filename">$ terminal</p>
<pre><code class="language-bash" data-trim data-noescape>
@@ -1071,7 +1112,7 @@ finistdevs-web : ok=4 changed=3 unreachable=0 failed=0 skipped=0
</aside>
</section>
<!-- ─── SLIDE 27 : Ansible operations ───────────────────────────── -->
<!-- ─── SLIDE 28 : Ansible operations ───────────────────────────── -->
<section class="s-ansible">
<h2>Not just configuration. Operations.</h2>
<ul>
@@ -1089,7 +1130,7 @@ finistdevs-web : ok=4 changed=3 unreachable=0 failed=0 skipped=0
</aside>
</section>
<!-- ─── SLIDE 28 : Ansible Galaxy ───────────────────────────────── -->
<!-- ─── SLIDE 29 : Ansible Galaxy ───────────────────────────────── -->
<section class="s-ansible">
<h2>The community does the heavy lifting.</h2>
<ul>
@@ -1106,7 +1147,7 @@ finistdevs-web : ok=4 changed=3 unreachable=0 failed=0 skipped=0
</aside>
</section>
<!-- ─── SLIDE 29 : Ansible platforms ────────────────────────────── -->
<!-- ─── SLIDE 30 : Ansible platforms ────────────────────────────── -->
<section class="s-ansible">
<h2>Ansible at scale: open-source vs enterprise.</h2>
<ul>
@@ -1124,7 +1165,7 @@ finistdevs-web : ok=4 changed=3 unreachable=0 failed=0 skipped=0
</aside>
</section>
<!-- ─── SLIDE 30 : Puppet intro ─────────────────────────────────── -->
<!-- ─── SLIDE 31 : Puppet intro ─────────────────────────────────── -->
<section class="s-puppet">
<h2><span class="puppet-col">Puppet</span></h2>
<p>Your servers are configured. Now keep them that way.</p>
@@ -1137,7 +1178,7 @@ finistdevs-web : ok=4 changed=3 unreachable=0 failed=0 skipped=0
</section>
<!-- ─── SLIDE 31 : What is Puppet ───────────────────────────────── -->
<!-- ─── SLIDE 32 : What is Puppet ───────────────────────────────── -->
<section class="s-puppet">
<h2>What is Puppet?</h2>
<ul>
@@ -1154,7 +1195,7 @@ finistdevs-web : ok=4 changed=3 unreachable=0 failed=0 skipped=0
</aside>
</section>
<!-- ─── SLIDE 32 : Puppet concepts ──────────────────────────────── -->
<!-- ─── SLIDE 33 : Puppet concepts ──────────────────────────────── -->
<section class="s-puppet">
<h2>Pull, not push. Agents, not SSH.</h2>
<ul>
@@ -1205,7 +1246,7 @@ finistdevs-web : ok=4 changed=3 unreachable=0 failed=0 skipped=0
</svg>
</section>
<!-- ─── SLIDE 33 : Puppet code ──────────────────────────────────── -->
<!-- ─── SLIDE 34 : Puppet code ──────────────────────────────────── -->
<section class="s-puppet">
<p class="filename"># manifests/webserver.pp</p>
<pre><code class="language-puppet" data-trim>
@@ -1235,7 +1276,7 @@ class webserver {
</aside>
</section>
<!-- ─── SLIDE 34 : Puppet CLI ───────────────────────────────────── -->
<!-- ─── SLIDE 35 : Puppet CLI ───────────────────────────────────── -->
<section class="s-puppet">
<p class="filename">$ terminal</p>
<pre><code class="language-bash" data-trim data-noescape>
@@ -1262,7 +1303,7 @@ Notice: Applied catalog in 12.34 seconds
</aside>
</section>
<!-- ─── SLIDE 35 : Puppet drift detection ───────────────────────── -->
<!-- ─── SLIDE 36 : Puppet drift detection ───────────────────────── -->
<section class="s-puppet">
<h2>Someone SSH'd in and changed something.</h2>
<ul>
@@ -1310,7 +1351,7 @@ Notice: Applied catalog in 12.34 seconds
</svg>
</section>
<!-- ─── SLIDE 36 : Puppet platforms ─────────────────────────────── -->
<!-- ─── SLIDE 37 : Puppet platforms ─────────────────────────────── -->
<section class="s-puppet">
<h2>Puppet: large fleets, zero drift.</h2>
<ul>
@@ -1328,7 +1369,7 @@ Notice: Applied catalog in 12.34 seconds
</aside>
</section>
<!-- ─── SLIDE 37 : Puppet community ─────────────────────────────── -->
<!-- ─── SLIDE 38 : Puppet community ─────────────────────────────── -->
<section class="s-puppet">
<h2>The ecosystem outlives the company.</h2>
<ul>
@@ -1345,7 +1386,7 @@ Notice: Applied catalog in 12.34 seconds
</aside>
</section>
<!-- ─── SLIDE 38 : They're complementary ────────────────────────── -->
<!-- ─── SLIDE 39 : They're complementary ────────────────────────── -->
<section>
<h2>They're not competing. They're complementary.</h2>
<p>Each solves a different layer of the same problem.</p>
@@ -1384,7 +1425,7 @@ Notice: Applied catalog in 12.34 seconds
</svg>
</section>
<!-- ─── SLIDE 39 : Real-world stack ─────────────────────────────── -->
<!-- ─── SLIDE 40 : Real-world stack ─────────────────────────────── -->
<section>
<h2>A common production setup:</h2>
<ol>
@@ -1401,7 +1442,7 @@ Notice: Applied catalog in 12.34 seconds
</aside>
</section>
<!-- ─── SLIDE 40 : Closing ──────────────────────────────────────── -->
<!-- ─── SLIDE 41 : Closing ──────────────────────────────────────── -->
<section class="title-slide">
<h1>Questions?</h1>
<p class="subtitle">Thank you!</p>