Skip to content

Commit

Permalink
[AUTO] Static site update for c1f9c8f
Browse files Browse the repository at this point in the history
  • Loading branch information
gfaivre committed Mar 8, 2024
1 parent 7ee99a2 commit 2aa70f7
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
6 changes: 3 additions & 3 deletions blog/cours/ansible/ansible-les-playbooks/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -654,12 +654,12 @@ <h4 id="les-handlers" class="anchor-title"><a href="#les-handlers">Les handlers<
<span class="token key atrule">name</span><span class="token punctuation">:</span> haproxy
<span class="token key atrule">state</span><span class="token punctuation">:</span> restarted
<span class="token key atrule">listen</span><span class="token punctuation">:</span> restart_http_stack</code></pre>
<h4 id="les-instructions-import-et-export" class="anchor-title"><a href="#les-instructions-import-et-export">Les instructions import... et export...</a></h4>
<p>Vous l'aurez compris, si l'on conserve l'ensemble de nos instructions dans un seul playbook celui-ci peut rapidemnent devenir <strong>volumineux et difficile</strong> à maintenir. Pour autant séparer nos instructions dans des playbooks dédiés conduit invariablement à dupliquer certains blocs d'instructions ce qui n'est pas non plus l'idéal, fort heureusement il est possible de résoudre ces problématiques de manière élégante en utilisant différentes instructions préfixées <code class="code-inline" id="fe8630d1d657e9bb58b1a9260acd93cf">import_</code> et <code class="code-inline" id="0583300c259450db57fd2307fc84a673">export_</code>.</p>
<h4 id="les-instructions-import-et-include" class="anchor-title"><a href="#les-instructions-import-et-include">Les instructions import... et include...</a></h4>
<p>Vous l'aurez compris, si l'on conserve l'ensemble de nos instructions dans un seul playbook celui-ci peut rapidemnent devenir <strong>volumineux et difficile</strong> à maintenir. Pour autant séparer nos instructions dans des playbooks dédiés conduit invariablement à dupliquer certains blocs d'instructions ce qui n'est pas non plus l'idéal, fort heureusement il est possible de résoudre ces problématiques de manière élégante en utilisant différentes instructions préfixées <code class="code-inline" id="fe8630d1d657e9bb58b1a9260acd93cf">import_</code> et <code class="code-inline" id="84de53352b4e3287e6e12392a69dddc3">include_</code>.</p>
<p><strong>Avant de réorganiser nos travaux il est important de bien comprendre la différence entre les deux:</strong></p>
<ul>
<li>Les instructions de type <code class="code-inline" id="9ec8c49bdcba93e76013a10e3b107b76">import_*</code> sont « pré-traitées » au moment où les playbooks sont parcourus et donc avant leur exécution;</li>
<li>Les instructions de type <code class="code-inline" id="36d2653a72f06c6cd8c23ef246e0f785">export_*</code> sont traitées au moment où elles sont rencontrées durant l'exécution. </li>
<li>Les instructions de type <code class="code-inline" id="f22f9bf0ae1c0d546b1c9c5250df414d">include_*</code> sont traitées au moment où elles sont rencontrées durant l'exécution. </li>
</ul>
<p><strong>Réorganisons à présent nos playbooks en tenant compte de cette nouvelle information:</strong></p>
<ul>
Expand Down
10 changes: 6 additions & 4 deletions blog/cours/ansible/ansible-les-variables/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ <h3 id="definir-et-utiliser-un-nouveau-template" class="anchor-title"><a href="#
Afin de stocker 2 fichiers nous créerons un répertoire dédié à motd qui contiendra donc <code class="code-inline" id="1eeadef35e0afa776e8733abce2e8598">production.j2</code> et <code class="code-inline" id="ea44399be7b5e71b5d499f43a541e397">staging.j2</code></p>
<p>Pour ces deux nouveaux fichiers nous ajouterons les contenus suivants:</p>
<p>Pour la <strong>production</strong>:</p>
<pre class="code-multiline language-shell"><code class="language-shell" id="c17d0eca85ccece0095d521455b6d4cb"><span class="token shebang important">#!/bin/sh</span>
<pre class="code-multiline language-shell"><code class="language-shell" id="6448c6c3dafadcb17940de1eaa77b61b"><span class="token shebang important">#!/bin/sh</span>

<span class="token assign-left variable">MOTD</span><span class="token operator">=</span><span class="token variable"><span class="token variable">$(</span><span class="token function">cat</span> <span class="token operator">&lt;&lt;</span><span class="token string">'EOF'
[38;5;28m ____[0m[0m
Expand Down Expand Up @@ -532,7 +532,9 @@ <h3 id="definir-et-utiliser-un-nouveau-template" class="anchor-title"><a href="#
{{ motd.message | center(42) }}

EOF</span>
<span class="token variable">)</span></span></code></pre>
<span class="token variable">)</span></span>

<span class="token builtin class-name">printf</span> <span class="token string">"<span class="token variable">${MOTD}</span><span class="token entity" title="\n">\n</span><span class="token entity" title="\n">\n</span><span class="token entity" title="\n">\n</span>"</span></code></pre>
<p>Pour la <strong>staging</strong>:</p>
<pre class="code-multiline language-shell"><code class="language-shell" id="cf77f68cd822a62e0015d4f1a45c8871"><span class="token shebang important">#!/bin/sh</span>
<span class="token punctuation">{</span>% <span class="token builtin class-name">set</span> message <span class="token operator">=</span> motd.message -%<span class="token punctuation">}</span>
Expand Down Expand Up @@ -591,15 +593,15 @@ <h3 id="variabiliser-ses-fichiers-de-configuration" class="anchor-title"><a href
<li>l'ajout d'un fichier de configuration personnalisé;</li>
<li>le redémarrage du service.</li>
</ul>
<pre class="code-multiline language-yaml"><code class="language-yaml" id="b4658e72c9af370391d8fe8c4f06189b"><span class="token comment"># PHP</span>
<pre class="code-multiline language-yaml"><code class="language-yaml" id="31969ab1be20211fba78177cb8035036"><span class="token comment"># PHP</span>
<span class="token punctuation">-</span> <span class="token key atrule">name</span><span class="token punctuation">:</span> Install PHP<span class="token punctuation">-</span>FPM service
<span class="token key atrule">ansible.builtin.apt</span><span class="token punctuation">:</span>
<span class="token key atrule">name</span><span class="token punctuation">:</span> php<span class="token punctuation">-</span>fpm
<span class="token key atrule">state</span><span class="token punctuation">:</span> present
<span class="token punctuation">-</span> <span class="token key atrule">name</span><span class="token punctuation">:</span> PHP<span class="token punctuation">-</span>FPM <span class="token punctuation">&gt;</span> Configuration
<span class="token key atrule">ansible.builtin.template</span><span class="token punctuation">:</span>
<span class="token key atrule">src</span><span class="token punctuation">:</span> <span class="token string">"php/app.ini.j2"</span>
<span class="token key atrule">dest</span><span class="token punctuation">:</span> <span class="token string">"/etc/php-fpm/8.2/php-fpm/app.ini"</span>
<span class="token key atrule">dest</span><span class="token punctuation">:</span> <span class="token string">"/etc/php/8.2/fpm/app.ini"</span>

<span class="token key atrule">handlers</span><span class="token punctuation">:</span>
<span class="token punctuation">-</span> <span class="token key atrule">name</span><span class="token punctuation">:</span> restart_php<span class="token punctuation">-</span>fpm
Expand Down
2 changes: 1 addition & 1 deletion blog/rss.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<description>Découvrez nos articles techniques (ou non), rédigés par les membres de l'équipe Rix !</description>
<copyright>Rix - L’utilisation des flux RSS de rix.fr est réservée à un usage strictement personnel, non professionnel et non collectif. Toute autre exploitation doit faire l’objet d’une autorisation et donner lieu au versement d’une rémunération. Contact : [email protected]</copyright>
<link>https://rix-fr.github.io/rix/blog</link>
<pubDate>Mon, 26 Feb 2024 13:36:08 +0000</pubDate>
<pubDate>Fri, 08 Mar 2024 12:49:14 +0000</pubDate>
<language>fr</language>
<image>
<url>https://rix-fr.github.io/rix/apple-touch-icon.png</url>
Expand Down
12 changes: 6 additions & 6 deletions sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@
</url>
<url>
<loc>https://rix-fr.github.io/rix/</loc>
<lastmod>2024-02-26T13:36:18+00:00</lastmod> <changefreq>monthly</changefreq>
<lastmod>2024-03-08T12:49:25+00:00</lastmod> <changefreq>monthly</changefreq>
</url>
<url>
<loc>https://rix-fr.github.io/rix/a-propos</loc>
<lastmod>2024-02-26T13:36:18+00:00</lastmod> <changefreq>monthly</changefreq>
<lastmod>2024-03-08T12:49:25+00:00</lastmod> <changefreq>monthly</changefreq>
</url>
<url>
<loc>https://rix-fr.github.io/rix/services</loc>
<lastmod>2024-02-26T13:36:20+00:00</lastmod> <changefreq>monthly</changefreq>
<lastmod>2024-03-08T12:49:27+00:00</lastmod> <changefreq>monthly</changefreq>
</url>
<url>
<loc>https://rix-fr.github.io/rix/contact</loc>
<lastmod>2024-02-26T13:36:18+00:00</lastmod> <changefreq>monthly</changefreq>
<lastmod>2024-03-08T12:49:25+00:00</lastmod> <changefreq>monthly</changefreq>
</url>
<url>
<loc>https://rix-fr.github.io/rix/legal</loc>
<lastmod>2024-02-26T13:36:18+00:00</lastmod> <changefreq>monthly</changefreq>
<lastmod>2024-03-08T12:49:25+00:00</lastmod> <changefreq>monthly</changefreq>
</url>
<url>
<loc>https://rix-fr.github.io/rix/confidentialite</loc>
<lastmod>2024-02-26T13:36:18+00:00</lastmod> <changefreq>monthly</changefreq>
<lastmod>2024-03-08T12:49:25+00:00</lastmod> <changefreq>monthly</changefreq>
</url>
<url>
<loc>https://rix-fr.github.io/rix/blog/cours/ansible/ansible-les-roles</loc>
Expand Down

0 comments on commit 2aa70f7

Please sign in to comment.