<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Blog d&apos;un ingénieur informaticien parmi d&apos;autres...</title>
    <description>Blog myBlog = BlogFactory.getJekyllBlog();</description>
    <link>https://blog.courtine.org/</link>
    <atom:link href="https://blog.courtine.org/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Mon, 23 Mar 2026 14:13:27 +0100</pubDate>
    <lastBuildDate>Mon, 23 Mar 2026 14:13:27 +0100</lastBuildDate>
    <generator>Jekyll v4.4.1</generator>
    
      <item>
        <title>Adieu Google Suite</title>
        <description>&lt;div id=&quot;preamble&quot;&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;hr&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;le-drame&quot;&gt;Le drame&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Le 24 mai 2008, je reçus ce courriel de &lt;a href=&quot;https//www.google.fr/&quot;&gt;Google&lt;/a&gt;&amp;#160;:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;quoteblock&quot;&gt;
&lt;blockquote&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Cher administrateur Google Apps,&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Nous sommes très heureux de vous donner la possibilité d&amp;#8217;offrir de puissants outils de communication et de partage à courtine.org grâce à Google Apps.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;&amp;#8230;&amp;#8203;&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Bien cordialement,
L’équipe Google Apps&lt;/p&gt;
&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div class=&quot;attribution&quot;&gt;
&amp;#8212; google-apps-do-not-reply@google.com&lt;br&gt;
&lt;cite&gt;Google Apps : confirmation d&apos;inscription et étapes suivantes&lt;/cite&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;C&amp;#8217;était le début de mon utilisation des services &quot;&lt;em&gt;Google Apps for Business&lt;/em&gt;&quot;, qui seront par la suite renommés &quot;&lt;em&gt;Google Suite&lt;/em&gt;&quot;.
Je n&amp;#8217;en ai pas changé depuis lors, et mes adresses familiales &lt;code&gt;@courtine.org&lt;/code&gt; étaient donc gérées par &lt;a href=&quot;https//www.google.fr/&quot;&gt;Google&lt;/a&gt; depuis cette date.
J&amp;#8217;ai toujours été très satisfait par ce service&amp;#160;:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;ulist&quot;&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Il a une interface agréable à utiliser.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Il fonctionne bien.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Il a toutes les fonctionnalités pour répondre à mes besoins.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Il ne m&amp;#8217;a jamais coûté un centime.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;admonitionblock warning&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td class=&quot;icon&quot;&gt;
&lt;i class=&quot;fa icon-warning&quot; title=&quot;Warning&quot;&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class=&quot;content&quot;&gt;
Sur ce dernier point, j&amp;#8217;ai bien conscience que &quot;si c&amp;#8217;est gratuit, c&amp;#8217;est moi le produit&quot;.
Mais c&amp;#8217;est un compromis que j&amp;#8217;acceptais en connaissance de cause.
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Presque 14 ans plus tard, ce 26 janvier 2022, comme les autres utilisateurs du service, je reçois le courriel suivant&amp;#160;:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;quoteblock&quot;&gt;
&lt;blockquote&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Bonjour,&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Nous vous informons que l&amp;#8217;ancienne édition gratuite de G Suite dont vous disposez ne sera plus disponible à compter du 1er juillet 2022. Pour conserver vos services et vos comptes, vous devez passer à Google Workspace.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Nous avons lancé l&amp;#8217;ancienne édition gratuite de G Suite (l&amp;#8217;offre Google Apps originale destinée aux entreprises et aux établissements d&amp;#8217;enseignement) il y a 16 ans. Nous avons arrêté ce service en 2012, et nous allons maintenant migrer tous les utilisateurs restants vers un abonnement Google Workspace payant (basé sur les fonctionnalités que vous utilisez aujourd&amp;#8217;hui).&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;&amp;#8230;&amp;#8203;&lt;/p&gt;
&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div class=&quot;attribution&quot;&gt;
&amp;#8212; The Google Workspace Team &lt;workspace-noreply@google.com&gt;&lt;br&gt;
&lt;cite&gt;Action requise Passez à un abonnement Google Workspace&lt;/cite&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Alors, c&amp;#8217;est embêtant, mais je n&amp;#8217;en veux pas à &lt;a href=&quot;https//www.google.fr/&quot;&gt;Google&lt;/a&gt; de cette décision.
J&amp;#8217;ai bien conscience que le service qu&amp;#8217;ils offrent a un coût, et il n&amp;#8217;est pas anormal de le facturer.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;admonitionblock note&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td class=&quot;icon&quot;&gt;
&lt;i class=&quot;fa icon-note&quot; title=&quot;Note&quot;&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class=&quot;content&quot;&gt;
Finalement, la décision de &lt;a href=&quot;https//www.google.fr/&quot;&gt;Google&lt;/a&gt; me semble plutôt être une bonne nouvelle.
Elle va permettre de mettre sur un pied d&amp;#8217;égalité les différents fournisseurs de services.
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;trouver-une-alternative&quot;&gt;Trouver une alternative&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Le service de &lt;a href=&quot;https//www.google.fr/&quot;&gt;Google&lt;/a&gt; me convenant, j&amp;#8217;aurais été prêt à payer pour continuer à l&amp;#8217;utiliser.
Cependant, avec une utilisation assez minimale des fonctionnalités proposées (courriel, calendrier, annuaire de contacts) et une famille nombreuse, le tarif de base (un peu moins de 5€ par adresse et par mois) m&amp;#8217;a semblé particulièrement élevé pour une simple utilisation familiale.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;J&amp;#8217;ai donc cherché des alternatives.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;admonitionblock caution&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td class=&quot;icon&quot;&gt;
&lt;i class=&quot;fa icon-caution&quot; title=&quot;Caution&quot;&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class=&quot;content&quot;&gt;
Mes critères pour cette recherche sont surtout d&amp;#8217;avoir une solution à un tarif raisonnable.
La confidentialité et les garanties de chiffrement ne sont pas essentiels pour moi.
C&amp;#8217;est pour cette raison que je retiens pas &lt;a href=&quot;https://protonmail.com/fr/&quot;&gt;ProtonMail&lt;/a&gt; par exemple (sans doute très bien, mais aussi cher que &lt;a href=&quot;https://workspace.google.fr/intl/fr/&quot;&gt;Google Workspace&lt;/a&gt;).
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;sect2&quot;&gt;
&lt;h3 id=&quot;gmail&quot;&gt;GMail&lt;/h3&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;La solution &lt;a href=&quot;https//www.google.fr/&quot;&gt;Google&lt;/a&gt; étant satisfaisante, une première possibilité est de me créer des adresse &lt;a href=&quot;https://www.gmail.com&quot;&gt;GMail&lt;/a&gt;, et de rediriger les adresses &lt;code&gt;@courtine.org&lt;/code&gt; vers celles-ci.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;ulist&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Avantages&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;C&amp;#8217;est simple à mettre en œuvre (avec le service &quot;Routage des e-mails&quot; de &lt;a href=&quot;https://www.cloudflare.com/&quot;&gt;Cloudflare&lt;/a&gt; par exemple).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;C&amp;#8217;est transparent pour les utilisateurs (on conserve la même interface).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Ça reste gratuit.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ulist&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Inconvénients&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;On ne quitte finalement pas &lt;a href=&quot;https//www.google.fr/&quot;&gt;Google&lt;/a&gt;&amp;#8230;&amp;#8203;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&amp;#8230;&amp;#8203; et on reste donc le produit.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect2&quot;&gt;
&lt;h3 id=&quot;office-365&quot;&gt;Office 365&lt;/h3&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;&lt;a href=&quot;https://www.microsoft.com/&quot;&gt;Microsoft&lt;/a&gt; propose une offre &quot;&lt;a href=&quot;https://www.office.com/&quot;&gt;Office 365&lt;/a&gt; Famille&quot; à 100€ par an pour 6 personnes, soit 1,4€ par adresse et par mois.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;ulist&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Avantages&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;L&amp;#8217;interface des services &lt;a href=&quot;https://www.microsoft.com/&quot;&gt;Microsoft&lt;/a&gt;, bien pensée.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Le tarif raisonnable.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;La suite Office incluse dans le prix (même si nous n&amp;#8217;en avons pas l&amp;#8217;utilité).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ulist&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Inconvénients&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;On reste chez un GAFAM.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Il ne faut pas avoir besoin de plus de 6 adresses.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect2&quot;&gt;
&lt;h3 id=&quot;les-autres&quot;&gt;Les autres&lt;/h3&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;On a ensuite un certain nombre de fournisseurs alternatifs, qui a mon avis sont relativement équivalents&amp;#160;:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;ulist&quot;&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&quot;E-mail pro&quot; d&amp;#8217;&lt;a href=&quot;https://www.ovh.com/&quot;&gt;OVH&lt;/a&gt; (1€ par adresse et par mois).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Offre &quot;Mail&quot; de &lt;a href=&quot;https://www.gandi.net/&quot;&gt;Gandi&lt;/a&gt; (0,42€ par adresse et par mois).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;etc.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ulist&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Avantages&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;On quitte les GAFAM.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ulist&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Inconvénients&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;L&amp;#8217;interface web est souvent un &lt;a href=&quot;https://roundcube.net/&quot;&gt;RoundCube&lt;/a&gt;, moins pratique que les produits maison de &lt;a href=&quot;https//www.google.fr/&quot;&gt;Google&lt;/a&gt;/&lt;a href=&quot;https://www.microsoft.com/&quot;&gt;Microsoft&lt;/a&gt;/etc.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;admonitionblock caution&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td class=&quot;icon&quot;&gt;
&lt;i class=&quot;fa icon-caution&quot; title=&quot;Caution&quot;&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class=&quot;content&quot;&gt;
Il en existe encore certainement beaucoup d&amp;#8217;autres (et dont certaines sont peut-être même mieux adaptées à mes besoins)&amp;#8230;&amp;#8203;
Je n&amp;#8217;ai pas du tout la prétention de présenter un panel exhaustif mais uniquement les différentes options que j&amp;#8217;ai considérées.
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect2&quot;&gt;
&lt;h3 id=&quot;le-choix&quot;&gt;Le choix&lt;/h3&gt;
&lt;div class=&quot;admonitionblock note&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td class=&quot;icon&quot;&gt;
&lt;i class=&quot;fa icon-note&quot; title=&quot;Note&quot;&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class=&quot;content&quot;&gt;
Parmi les alternatives, il y avait également l&amp;#8217;auto-hébergement.
Cependant, je manque de temps pour m&amp;#8217;amuser à installer/configurer/gérer/maintenir ce genre de services&amp;#8230;&amp;#8203;
Je n&amp;#8217;ai donc pas creusé cette solution ni les différentes manières possibles de la mettre en pratique.
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Quitte essayer de m&amp;#8217;affranchir &lt;a href=&quot;https//www.google.fr/&quot;&gt;Google&lt;/a&gt;, j&amp;#8217;ai voulu aller au bout de la démarche, en ne migrant ni vers &lt;a href=&quot;https://www.gmail.com&quot;&gt;GMail&lt;/a&gt;, ni un autre GAFAM (et donc en excluant &lt;a href=&quot;https://www.office.com/&quot;&gt;Office 365&lt;/a&gt;).
J&amp;#8217;ai donc finalement opté pour l&amp;#8217;offre mail de &lt;a href=&quot;https://www.gandi.net/&quot;&gt;Gandi&lt;/a&gt; (chez qui j&amp;#8217;avais déjà un compte, mes noms de domaine y étant enregistrés).&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;admonitionblock caution&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td class=&quot;icon&quot;&gt;
&lt;i class=&quot;fa icon-caution&quot; title=&quot;Caution&quot;&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class=&quot;content&quot;&gt;
Les boites basiques chez &lt;a href=&quot;https://www.gandi.net/&quot;&gt;Gandi&lt;/a&gt; sont limitées à 3Go, contre 15 pour les comptes &lt;a href=&quot;https//www.google.fr/&quot;&gt;Google&lt;/a&gt;.
Le choix de &lt;a href=&quot;https://www.gandi.net/&quot;&gt;Gandi&lt;/a&gt; a donc été possible parce que je n&amp;#8217;utilisais qu&amp;#8217;une très faible portion du stockage &lt;a href=&quot;https//www.google.fr/&quot;&gt;Google&lt;/a&gt; (moins de 2 Go pour le plus gros compte).
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;la-migration&quot;&gt;La migration&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;sect2&quot;&gt;
&lt;h3 id=&quot;adresses-et-enregistrements-dns&quot;&gt;Adresses et enregistrements DNS&lt;/h3&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Je commence par créer les adresses, alias, redirections&amp;#8230;&amp;#8203; chez &lt;a href=&quot;https://www.gandi.net/&quot;&gt;Gandi&lt;/a&gt;, afin d&amp;#8217;avoir les boites souhaitées (à l&amp;#8217;identique de celles présentes chez &lt;a href=&quot;https//www.google.fr/&quot;&gt;Google&lt;/a&gt;, pour ne pas perdre de messages une fois la migration effectuée).&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Je modifie ensuite les enregistrements &lt;a href=&quot;https://fr.wikipedia.org/wiki/Enregistrement_Mail_eXchanger&quot;&gt;MX&lt;/a&gt;, afin de commencer le routage des nouveaux messages vers les nouvelles boites.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;admonitionblock caution&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td class=&quot;icon&quot;&gt;
&lt;i class=&quot;fa icon-caution&quot; title=&quot;Caution&quot;&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class=&quot;content&quot;&gt;
Chez &lt;a href=&quot;https://www.gandi.net/&quot;&gt;Gandi&lt;/a&gt;, la documentation initiale ne concerne que le routage.
Il faut se rendre sur &lt;a href=&quot;https://docs.gandi.net/fr/gandimail/operations_courantes/activer_outils_antispoofing.html&quot;&gt;la page antispoofing&lt;/a&gt; pour avoir le complément d&amp;#8217;information sur les enregistrements &lt;code&gt;DKIM&lt;/code&gt;, &lt;code&gt;SPF&lt;/code&gt;, &lt;code&gt;DMARC&lt;/code&gt;.
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;listingblock&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Configuration DNS complète&lt;/div&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;pre class=&quot;rouge highlight&quot;&gt;&lt;code data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; Routage
@ 10800 IN MX 10 spool.mail.gandi.net.
@ 10800 IN MX 50 fb.mail.gandi.net.
&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; SPF
@ 10800 IN TXT &lt;span class=&quot;s2&quot;&gt;&quot;v=spf1 include:_mailcust.gandi.net ?all&quot;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; DMARC
_dmarc 10800 IN TXT &lt;span class=&quot;s2&quot;&gt;&quot;v=DMARC1; p=reject; rua=mailto:admin@mondomaine.tld&quot;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; DKIM
gm1._domainkey 10800 IN CNAME gm1.gandimail.net.
gm2._domainkey 10800 IN CNAME gm2.gandimail.net.
gm3._domainkey 10800 IN CNAME gm3.gandimail.net.&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Le temps de passer l&amp;#8217;expiration des DNS, et on vérifie que les nouveaux messages arrivent bien dans la boite aux lettres &lt;a href=&quot;https://www.gandi.net/&quot;&gt;Gandi&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect2&quot;&gt;
&lt;h3 id=&quot;récupération-de-lhistorique&quot;&gt;Récupération de l&amp;#8217;historique&lt;/h3&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Maintenant que les nouveaux messages arrivent dans les boites &lt;a href=&quot;https://www.gandi.net/&quot;&gt;Gandi&lt;/a&gt;, il reste à récupérer l&amp;#8217;historique.
Pour cela, j&amp;#8217;ai utilisé l&amp;#8217;excellent &lt;a href=&quot;https://github.com/imapsync/imapsync&quot;&gt;imapsync&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Cet outil dispose de très nombreuses options particulièrement utiles dans le cadre de cette migration&amp;#160;:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;ulist&quot;&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;un mode spécial &quot;&lt;a href=&quot;https://www.gmail.com&quot;&gt;GMail&lt;/a&gt;&quot;, qui active des options bien pensées&amp;#160;:&lt;/p&gt;
&lt;div class=&quot;ulist&quot;&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;la conversion automatique des tags en dossiers.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;le dédoublonnage des messages ayant plusieurs tags.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;la synchronisation en dernier du dossier &quot;&lt;em&gt;[Gmail]/All Mail&lt;/em&gt;&quot; (on ne trouve dans ce dossier que les messages archivés qui n&amp;#8217;avaient aucun tag).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;etc.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;la possibilité d&amp;#8217;arrêter et de reprendre la synchronisation ultérieurement.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;admonitionblock tip&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td class=&quot;icon&quot;&gt;
&lt;i class=&quot;fa icon-tip&quot; title=&quot;Tip&quot;&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class=&quot;content&quot;&gt;
Au même titre que le mode &quot;&lt;a href=&quot;https://www.gmail.com&quot;&gt;GMail&lt;/a&gt;&quot;, il existe des modes &lt;a href=&quot;https://www.office.com/&quot;&gt;Office 365&lt;/a&gt;, Exchange et Domino.
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Configuration Google préalable&lt;/div&gt;
&lt;p&gt;Avant la migration, il faut dans les paramètres de la boite autoriser la connecion IMAP.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Il faut également permettre à &lt;a href=&quot;https://github.com/imapsync/imapsync&quot;&gt;imapsync&lt;/a&gt; de se connecter.
Dans les paramètres de &lt;a href=&quot;https://myaccount.google.com/&quot;&gt;Mon compte Google&lt;/a&gt;&amp;#160;:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;ulist&quot;&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;si on a activé l&amp;#8217;identification à deux facteurs, il faut générer un mot de passe d&amp;#8217;application à usage unique.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;dans le cas contraire, il est possible d&amp;#8217;activer &quot;l&amp;#8217;accès moins sécurisé&quot;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;admonitionblock warning&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td class=&quot;icon&quot;&gt;
&lt;i class=&quot;fa icon-warning&quot; title=&quot;Warning&quot;&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class=&quot;content&quot;&gt;
Cette dernière possibilité disparaît le 30 mai 2022.
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;listingblock&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Lancement de la migration&lt;/div&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;pre class=&quot;rouge highlight&quot;&gt;&lt;code data-lang=&quot;bash&quot;&gt;imapsync &lt;span class=&quot;nt&quot;&gt;--gmail1&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--user1&lt;/span&gt; adresse@mondomaine.tld &lt;span class=&quot;nt&quot;&gt;--password1&lt;/span&gt; MonAncienSuperMotDePasse &lt;span class=&quot;nt&quot;&gt;--host2&lt;/span&gt; mail.gandi.net &lt;span class=&quot;nt&quot;&gt;--user2&lt;/span&gt; adresse@mondomaine.tld &lt;span class=&quot;nt&quot;&gt;--password2&lt;/span&gt; MonNouveauSuperMotDePasse&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;et-le-reste&quot;&gt;Et le reste ?&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;La messagerie était le service principal que nous utilisions.
Mais nous avions également un peu de &lt;a href=&quot;https://www.google.com/intl/fr/drive/&quot;&gt;Google Drive&lt;/a&gt;, la synchronisation des contacts et des calendriers.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;admonitionblock note&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td class=&quot;icon&quot;&gt;
&lt;i class=&quot;fa icon-note&quot; title=&quot;Note&quot;&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class=&quot;content&quot;&gt;
Sur l&amp;#8217;ensemble de l&amp;#8217;opération, j&amp;#8217;ai trouvé &lt;a href=&quot;https//www.google.fr/&quot;&gt;Google&lt;/a&gt; exemplaire dans les possibilités offertes de récupérer ses données pour les migrer ailleurs.
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;ulist&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Quelques exemples&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;un accès IMAP simple à mettre en place, y compris quand on a activé l&amp;#8217;identification à deux facteurs.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;de multiples formats d&amp;#8217;export standard pour les contacts (csv, vCard, etc.) et les calendriers (ics, etc.).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://takeout.google.com/&quot;&gt;Google Takeout&lt;/a&gt;, pour l&amp;#8217;export de toutes ses autres données.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Pour les contacts/calendriers, notre besoin principal était la synchronisation sur le téléphone.
Et comme nous utilisons des &lt;a href=&quot;https://www.apple.com/fr/iphone/&quot;&gt;iPhone&lt;/a&gt;, nous avons opté dans un premier temps pour &lt;a href=&quot;https://www.icloud.com/&quot;&gt;iCloud&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;admonitionblock warning&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td class=&quot;icon&quot;&gt;
&lt;i class=&quot;fa icon-warning&quot; title=&quot;Warning&quot;&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class=&quot;content&quot;&gt;
Par rapport à l&amp;#8217;export &lt;a href=&quot;https//www.google.fr/&quot;&gt;Google&lt;/a&gt;, l&amp;#8217;expérience de l&amp;#8217;import sur &lt;a href=&quot;https://www.icloud.com/&quot;&gt;iCloud&lt;/a&gt; et de son utilisation est assez catastrophique (l&amp;#8217;interface web est minimaliste en ergonomie et en fonctionnalités).
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;ulist&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Quelques exemples&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;pas de gestion de fusion des contacts en doublon.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;pas de possibilité d&amp;#8217;importer un calendrier à partir d&amp;#8217;un fichier ics (il faut obligatoirement passer par l&amp;#8217;application dédiée sur un &lt;a href=&quot;https://www.apple.com/fr/mac/&quot;&gt;Mac&lt;/a&gt; pour ça).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Finalement, je suis déçu par le manque d&amp;#8217;efforts d&amp;#8217;&lt;a href=&quot;https://www.apple.com/&quot;&gt;Apple&lt;/a&gt; sur ces produits.
Si j&amp;#8217;ai le temps, j&amp;#8217;essayerai de trouver une meilleure alternative.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;admonitionblock tip&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td class=&quot;icon&quot;&gt;
&lt;i class=&quot;fa icon-tip&quot; title=&quot;Tip&quot;&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class=&quot;content&quot;&gt;
Je commence tout juste à regarder &lt;a href=&quot;https://nextcloud.com/&quot;&gt;Nextcloud&lt;/a&gt;&amp;#8230;&amp;#8203; même si ça me semble très lourd par rapport au besoin, et qu&amp;#8217;on revient à de l&amp;#8217;auto-hébergement que je préférerais éviter.
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;bilan&quot;&gt;Bilan&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;La migration est terminée, et les nouvelles habitudes se prennent vite.
Plusieurs fonctionnalités me manquent&amp;#8230;&amp;#8203; en particulier la gestion des comptes multiples, et la possibilité de passer rapidement de l&amp;#8217;un à l&amp;#8217;autre sans avoir besoin de se déconnecter/reconnecter.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Pour remédier au problème, ainsi qu&amp;#8217;au manque de fonctionnalités et d&amp;#8217;ergonomie, je vais probablement gérer mes messages depuis un logiciel client (&lt;a href=&quot;https://www.thunderbird.net/&quot;&gt;Thunderbird&lt;/a&gt; par exemple), alors que je n&amp;#8217;utilisais plus que l&amp;#8217;interface web.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;admonitionblock tip&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td class=&quot;icon&quot;&gt;
&lt;i class=&quot;fa icon-tip&quot; title=&quot;Tip&quot;&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class=&quot;content&quot;&gt;
P.S. Pour les retardataires, &lt;a href=&quot;https//www.google.fr/&quot;&gt;Google&lt;/a&gt; vient de repousser d&amp;#8217;un mois la date limite pour migrer vers &lt;a href=&quot;https://workspace.google.fr/intl/fr/&quot;&gt;Google Workspace&lt;/a&gt; ou ailleurs.
Ils proposent une offre spéciale de migration &quot;Starter Pack&quot; à 3$ par utilisateur et par mois.
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</description>
        <pubDate>Mon, 09 May 2022 00:00:00 +0200</pubDate>
        <link>https://blog.courtine.org/2022/05/09/adieu-google-suite/</link>
        <guid isPermaLink="true">https://blog.courtine.org/2022/05/09/adieu-google-suite/</guid>
        
        <category>perso</category>
        
        
      </item>
    
      <item>
        <title>Mon Devoxx France 2022</title>
        <description>&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;enfin&quot;&gt;Enfin !&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Après quelques années d&amp;#8217;absence, j&amp;#8217;avais réservé ma place pour &lt;a href=&quot;https://www.devoxx.fr/&quot;&gt;Devoxx&lt;/a&gt; 2020&amp;#8230;&amp;#8203; qui a &lt;a href=&quot;https://www.devoxx.fr/2020/04/15/devoxx-france-2020-est-annule/&quot;&gt;été annulé&lt;/a&gt; (avec raison).
J&amp;#8217;aurais pu participer à l&amp;#8217;édition 2021, mais malgré l&amp;#8217;obligation du pass vaccinal, j&amp;#8217;ai préféré décliner par peur d&amp;#8217;un grand rassemblement en période COVID.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Nous voici donc en 2022, et je suis bien décidé à participer cette fois&amp;#160;!
Je m&amp;#8217;inscris donc via la formation &lt;a href=&quot;https://www.oxiane.com/&quot;&gt;Oxiane&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;commençons-par-ce-qui-fâche&quot;&gt;Commençons par ce qui fâche&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Faux départ&lt;/div&gt;
&lt;p&gt;Avant d&amp;#8217;arriver, le premier désagrément viendra de la &lt;a href=&quot;https://www.ratp.fr/&quot;&gt;RATP&lt;/a&gt;, avec un incident sur ma ligne (RER B) et le retard qui va avec.
Sur les 3 jours de conférence, soit 6 trajets, j&amp;#8217;ai rencontré 4 incidents sur cette ligne&amp;#160;!
La &lt;a href=&quot;https://www.ratp.fr/&quot;&gt;RATP&lt;/a&gt; n&amp;#8217;est pas fautive dans tous les cas (personnes sur les voies&amp;#8230;&amp;#8203;), mais il demeure que &quot;l&amp;#8217;expérience utilisateur&quot; est très mauvaise (retard et rames bondées).&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;imageblock text-center&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;a class=&quot;image&quot; href=&quot;/images/devoxx/devoxxfr_2022_ratp.png&quot;&gt;&lt;img src=&quot;/images/devoxx/devoxxfr_2022_ratp.png&quot; alt=&quot;Attente RATP&quot;&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;div class=&quot;title&quot;&gt;L&amp;#8217;enregistrement&lt;/div&gt;
&lt;p&gt;Ayant pris de l&amp;#8217;avance, j&amp;#8217;arrive finalement juste avant l&amp;#8217;heure de début&amp;#8230;&amp;#8203; pour tomber sur la file d&amp;#8217;attente &lt;a href=&quot;https://www.oxiane.com/&quot;&gt;Oxiane&lt;/a&gt;.
Il faudra 45 minutes pour signer la feuille d&amp;#8217;émargement et récupérer le badge.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;imageblock text-center&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;a class=&quot;image&quot; href=&quot;/images/devoxx/devoxxfr_2022_enregistrement.png&quot;&gt;&lt;img src=&quot;/images/devoxx/devoxxfr_2022_enregistrement.png&quot; alt=&quot;L&amp;#8217;enregistrement Oxiane&quot;&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;admonitionblock note&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td class=&quot;icon&quot;&gt;
&lt;i class=&quot;fa icon-note&quot; title=&quot;Note&quot;&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class=&quot;content&quot;&gt;
Immédiatement après la conférence, nous avons reçu un message d&amp;#8217;excuse, ainsi que l&amp;#8217;explication de ce délai anormal (un bug informatique&amp;#160;!).
J&amp;#8217;ai donc bon espoir que ça ne se reproduira plus&amp;#8230;&amp;#8203; même s&amp;#8217;il aurait sans doute été possible de faire mieux (reporter l&amp;#8217;émargement au cours de la journée en demandant de repasser à l&amp;#8217;accueil ou sur le stand par exemple).
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Le port du masque&lt;/div&gt;
&lt;p&gt;Malgré la consigne de port du masque, j&amp;#8217;ai trouvé que celle-ci n&amp;#8217;était que moyennement respectée.
Elle l&amp;#8217;était par une grande majorité des participants, mais où qu&amp;#8217;on regarde, on tombait toujours sur plusieurs personnes non masquées.
Je comprends le relâchement, mais j&amp;#8217;ai trouvé ça dommage.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;admonitionblock note&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td class=&quot;icon&quot;&gt;
&lt;i class=&quot;fa icon-note&quot; title=&quot;Note&quot;&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class=&quot;content&quot;&gt;
Depuis la fin de la conférence, plusieurs messages sur les réseaux sociaux de participants ayant attrapé la COVID.
Je ne suis pas expert, mais vu le brassage durant ces 3 jours, je suis loin d&amp;#8217;être persuadé que le laxisme soit en cause dans ces contaminations&amp;#8230;&amp;#8203;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;une-conférence-au-top&quot;&gt;Une conférence au top !&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;admonitionblock important&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td class=&quot;icon&quot;&gt;
&lt;i class=&quot;fa icon-important&quot; title=&quot;Important&quot;&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class=&quot;content&quot;&gt;
Les quelques réserves ci-dessus ne me font pas perdre de vue l&amp;#8217;essentiel&amp;#160;: la conférence était géniale, et l&amp;#8217;organisation fantastique&amp;#160;!
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;div class=&quot;title&quot;&gt;L&amp;#8217;organisation&lt;/div&gt;
&lt;p&gt;Malgré les plus de 3000 participants, la circulation a toujours été fluide, y compris pour l&amp;#8217;heure du repas ou le &quot;Meet and greet&quot;.
Lorsqu&amp;#8217;une salle était pleine, on était redirigée vers les autres conférences, ou vers un lieu de rediffusion.
J&amp;#8217;imagine à peine le travail que ça a demandé aux gilets rouges, tant en amont que pendant la conférence.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Des rencontres &quot;IRL&quot;&lt;/div&gt;
&lt;p&gt;&lt;a href=&quot;https://www.devoxx.fr/&quot;&gt;Devoxx&lt;/a&gt;, c&amp;#8217;est toujours l&amp;#8217;occasion de revoir des connaissances&amp;#8230;&amp;#8203; et de s&amp;#8217;en faire de nouvelles&amp;#160;!
Et après plusieurs années de crise sanitaire pendant lesquelles on ne s&amp;#8217;était pas vus, c&amp;#8217;était particulièrement plaisant&amp;#160;!&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Des stands sympas&lt;/div&gt;
&lt;p&gt;Avant même de parler des conférences elles-mêmes, il y avait pas mal de choses intéressantes à voir sur les stands.
Une toute petite sélection&amp;#160;:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;ulist&quot;&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Le stand &lt;a href=&quot;https://www.commitstrip.com/fr/&quot;&gt;Commit Strip&lt;/a&gt; (et sa fresque), sur lequel j&amp;#8217;ai pu acheter le dernier tome (dédicacé) &quot;&lt;em&gt;The summer of code&lt;/em&gt;&quot;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Le stand voisin des &lt;a href=&quot;https://webosaures.com/&quot;&gt;Webosaures&lt;/a&gt;, et leur incroyable exposition de machines rétros.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Le stand &lt;a href=&quot;https://www.axa.fr/&quot;&gt;Axa&lt;/a&gt;, pour leur sympatique jeu vidéo à base de &lt;a href=&quot;https://www.ultraleap.com/&quot;&gt;Leap Motion&lt;/a&gt; (ça faisait longtemps que j&amp;#8217;en avais vu un).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Et tous les autres stands pour leurs goodies&amp;#8230;&amp;#8203; Que serait un &lt;a href=&quot;https://www.devoxx.fr/&quot;&gt;Devoxx&lt;/a&gt; sans goodies&amp;#160;?&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;imageblock text-center&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;a class=&quot;image&quot; href=&quot;/images/devoxx/devoxxfr_2022_webosaures.png&quot;&gt;&lt;img src=&quot;/images/devoxx/devoxxfr_2022_webosaures.png&quot; alt=&quot;Le stand des webosaures&quot;&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;les-conférences&quot;&gt;Les conférences&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;admonitionblock tip&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td class=&quot;icon&quot;&gt;
&lt;i class=&quot;fa icon-tip&quot; title=&quot;Tip&quot;&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class=&quot;content&quot;&gt;
Elles seront bientôt disponibles sur &lt;a href=&quot;https://www.youtube.com/c/DevoxxFRvideos&quot;&gt;la chaîne Youtube Devoxx France&lt;/a&gt;.
Et comme elles étaient toutes excellentes, je ne peux que vous recommander de filer les voir&amp;#160;!
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Mes coups de cœur&lt;/div&gt;
&lt;p&gt;Parmi celles auxquelles j&amp;#8217;ai assisté&amp;#160;: il en manque donc 95%, ce qui donnera une sélection très peu objective.
Et ce d&amp;#8217;autant plus que j&amp;#8217;ai manqué plusieurs conférences qui me faisaient très envie, faute de place disponible&amp;#160;: il faudra donc que j&amp;#8217;attende pour les voir.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;ulist&quot;&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;La keynote &quot;&lt;em&gt;La quête d&amp;#8217;une gouvernance collaborative du web&lt;/em&gt;&quot; de &lt;a href=&quot;https://fr.wikipedia.org/wiki/L%C3%AA_Nguy%C3%AAn_Hoang&quot;&gt;Lê Nguyên Hoang&lt;/a&gt;, et son outil de recommandation &lt;a href=&quot;https://tournesol.app/&quot;&gt;Tournesol&lt;/a&gt; qu&amp;#8217;il me tarde de tester.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;La conférence &quot;&lt;em&gt;Valhalla: To the Hell and Back&lt;/em&gt;&quot; de &lt;a href=&quot;http://monge.univ-mlv.fr/~forax/&quot;&gt;Rémi Forax&lt;/a&gt;, parceque c&amp;#8217;est toujours intéressant de voir l&amp;#8217;envers du décor et de comprendre les cheminements et les problématiques rencontrées dans l&amp;#8217;implémentation des fonctionnalités du langage.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&quot;&lt;em&gt;Doctolib a besoin d&amp;#8217;une base de données plus puissante. Ok, mais laquelle&amp;#160;?&lt;/em&gt;&quot; de Bertrand Paquet et David Gageot, pour la même raison.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&quot;&lt;em&gt;Cryptanalyse de la machine Enigma : entre espionnage et mathématiques&lt;/em&gt;&quot; de Jean-Christophe Sirot.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&quot;&lt;em&gt;Qu&amp;#8217;est-ce que l&amp;#8217;InnerSource ? Comment ça se met en place et pourquoi ça va améliorer votre IT &amp;#8230;&amp;#8203; mais pas que ?&lt;/em&gt;&quot; par Philippe Charrière et Matthieu Vincent.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Des choses à tester&lt;/div&gt;
&lt;p&gt;Au cours de ces 3 jours, j&amp;#8217;ai noté (lors des conférences ou sur les stands) un certain nombre de choses à tester (au travail ou sur des projets personnels)&amp;#160;:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;ulist&quot;&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Programmer une extension de navigateur&amp;#160;: parce qu&amp;#8217;après avoir assisté à la conférence &quot;&lt;em&gt;Gagner du temps en créant des extensions pour vos navigateurs&lt;/em&gt;&quot;,  ça semble finalement assez abordable.
Bon&amp;#8230;&amp;#8203; encore faut-il trouver une idée d&amp;#8217;extension.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;La nouvelle fonction &lt;a href=&quot;https://developer.chrome.com/docs/devtools/recorder/&quot;&gt;Recorder&lt;/a&gt; de &lt;a href=&quot;https://www.google.com/intl/fr_fr/chrome/&quot;&gt;Chrome&lt;/a&gt;.
Ça semble super pour automatiser le rejeu de scénarios de tests manuels en développement web.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Les générateurs de pipeline &lt;a href=&quot;https://to-be-continuous.gitlab.io/&quot;&gt;To be continuous&lt;/a&gt; (ou l&amp;#8217;équivalent de &lt;a href=&quot;https://www.soprasteria.com/fr&quot;&gt;Sopra-Steria&lt;/a&gt; mais dont je ne retrouve plus le lien) pour &lt;a href=&quot;https://about.gitlab.com/&quot;&gt;Gitlab&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;La librairie &lt;a href=&quot;https://www.testcontainers.org/&quot;&gt;Test Containers&lt;/a&gt; pour automatiser l&amp;#8217;instanciation de conteneurs Docker pour les tests d&amp;#8217;intégration.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Le &lt;a href=&quot;https://webassembly.org/&quot;&gt;WASM&lt;/a&gt; (généré à partir de &lt;a href=&quot;https://www.rust-lang.org/fr&quot;&gt;Rust&lt;/a&gt;)&amp;#8230;&amp;#8203; mais là encore, il faudrait tout d&amp;#8217;abord avoir une idée de cas d&amp;#8217;utilisation.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://vitejs.dev/&quot;&gt;Vite&lt;/a&gt; en remplacement de &lt;a href=&quot;https://webpack.js.org/&quot;&gt;Webpack&lt;/a&gt; pour la construction des applications web.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Et pas mal d&amp;#8217;autres choses encore&amp;#8230;&amp;#8203;&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;imageblock text-center&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;a class=&quot;image&quot; href=&quot;/images/devoxx/devoxxfr_2022_wasm.png&quot;&gt;&lt;img src=&quot;/images/devoxx/devoxxfr_2022_wasm.png&quot; alt=&quot;L&amp;#8217;université WASM&quot;&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Un énorme merci à toute l&amp;#8217;équipe pour cette super édition des 10 ans&amp;#160;!&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;En espérant que l&amp;#8217;année prochaine, la situation permette de reprendre les &lt;a href=&quot;https://www.devoxx4kids.org/france/&quot;&gt;Devoxx4Kids&lt;/a&gt; dans la foulée de la conférence&amp;#160;!&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</description>
        <pubDate>Wed, 27 Apr 2022 00:00:00 +0200</pubDate>
        <link>https://blog.courtine.org/2022/04/27/mon-devoxx-france-2022/</link>
        <guid isPermaLink="true">https://blog.courtine.org/2022/04/27/mon-devoxx-france-2022/</guid>
        
        <category>perso</category>
        
        
      </item>
    
      <item>
        <title>Adieu Google Analytics</title>
        <description>&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Il y a plus d&amp;#8217;un an, j&amp;#8217;écrivais en conclusion &lt;a href=&quot;/2020/11/30/gitlab-pages/&quot;&gt;d&amp;#8217;un article&lt;/a&gt;&amp;#160;:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;quoteblock&quot;&gt;
&lt;blockquote&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Je n&amp;#8217;ai conservé qu&amp;#8217;un &lt;a href=&quot;https://analytics.google.com/&quot;&gt;Google Analytics&lt;/a&gt; (anonymisé)&amp;#8230;&amp;#8203; mais je le consulte tellement peu que je songe à le supprimer également.&lt;/p&gt;
&lt;/div&gt;
&lt;/blockquote&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Depuis, je n&amp;#8217;ai que très peu pris le temps de m&amp;#8217;occuper de ce blog&amp;#8230;&amp;#8203; et encore moins d&amp;#8217;en consulter les informations de fréquentation (probablement peu reluisantes).
Je peux donc confirmer sans difficulté que je n&amp;#8217;ai pas l&amp;#8217;utilité de ces statistiques.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Mais, ce qui m&amp;#8217;a finalement poussé à mettre à jour ce blog pour supprimer &lt;a href=&quot;https://analytics.google.com/&quot;&gt;Google Analytics&lt;/a&gt;, c&amp;#8217;est la récente décision de la &lt;a href=&quot;https://www.cnil.fr/&quot;&gt;CNIL&lt;/a&gt; de &lt;a href=&quot;https://www.cnil.fr/fr/utilisation-de-google-analytics-et-transferts-de-donnees-vers-les-etats-unis-la-cnil-met-en-demeure&quot;&gt;mettre en demeure une société de cesser son utilisation&lt;/a&gt;.
La solution de &lt;a href=&quot;https://www.google.fr&quot;&gt;Google&lt;/a&gt; n&amp;#8217;est en effet pas conforme au &lt;a href=&quot;https://www.economie.gouv.fr/entreprises/reglement-general-sur-protection-des-donnees-rgpd&quot;&gt;RGPD&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;admonitionblock note&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td class=&quot;icon&quot;&gt;
&lt;i class=&quot;fa icon-note&quot; title=&quot;Note&quot;&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class=&quot;content&quot;&gt;
C&amp;#8217;est donc maintenant chose faite (depuis quelques jours déjà).
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Et comme c&amp;#8217;était l&amp;#8217;unique librairie qui utilisait un cookie, j&amp;#8217;ai pu en profiter pour simplifier les &lt;a href=&quot;/legal/&quot;&gt;mentions légales&lt;/a&gt; et supprimer le bandeau d&amp;#8217;avertissement.
Enfin, je n&amp;#8217;ai pour l&amp;#8217;instant aucune intention de mettre en place une solution de statistiques de remplacement (même si la &lt;a href=&quot;https://www.cnil.fr/&quot;&gt;CNIL&lt;/a&gt; en &lt;a href=&quot;https://www.cnil.fr/fr/cookies-solutions-pour-les-outils-de-mesure-daudience&quot;&gt;propose un certain nombre&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;</description>
        <pubDate>Wed, 23 Feb 2022 00:00:00 +0100</pubDate>
        <link>https://blog.courtine.org/2022/02/23/adieu-google-analytics/</link>
        <guid isPermaLink="true">https://blog.courtine.org/2022/02/23/adieu-google-analytics/</guid>
        
        <category>perso</category>
        
        
      </item>
    
      <item>
        <title>Terraformisation de l&amp;#8217;infrastructure VSphere existante</title>
        <description>&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Dans &lt;a href=&quot;/2020/12/08/deploiement-vsphere-terraform/&quot;&gt;l&amp;#8217;article précédent&lt;/a&gt;, nous avons vu comment gérer notre infrastructure &lt;a href=&quot;https://www.vmware.com/fr/products/vsphere.html&quot;&gt;VSphere&lt;/a&gt; avec &lt;a href=&quot;https://www.terraform.io/&quot;&gt;Terraform&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Lorsque nous mettons cela en place sur un serveur VSphere existant, il peut déjà contenir des machines virtuelles, qui ne sont pas gérées par Terraform.
On peut donc souhaiter réintégrer ces machines dans Terraform.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Une solution est évidemment de les supprimer pour les recréer avec Terraform, mais on ne souhaite pas nécessairement utiliser une méthode aussi radicale.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;déclaration-de-la-machine&quot;&gt;Déclaration de la machine&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;En utilisant le module décrit dans l&amp;#8217;article précédent, nous déclarons la machine, en reprenant ses caractéristiques&amp;#160;:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;listingblock&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Fichier main.tf&lt;/div&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;pre class=&quot;rouge highlight&quot;&gt;&lt;code data-lang=&quot;bash&quot;&gt;module &lt;span class=&quot;s2&quot;&gt;&quot;vm_preexistante&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;source&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;./modules/ubuntu20.04&quot;&lt;/span&gt;

  vm_hostname &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;vm_preexistante&quot;&lt;/span&gt;
  vm_ip &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;192.168.0.15&quot;&lt;/span&gt;
  vm_num_cpus &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 4
  vm_memory &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 4096
  vm_datastore &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;datastore1&quot;&lt;/span&gt;
  vm_disks &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;disk0&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt; size &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 60 &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;admonitionblock warning&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td class=&quot;icon&quot;&gt;
&lt;i class=&quot;fa icon-warning&quot; title=&quot;Warning&quot;&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class=&quot;content&quot;&gt;
À ce stade, si on tente d&amp;#8217;appliquer le fichier (ou si on demande le plan), Terraform ignorant que la machine existe déjà va vouloir la créer.
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;import-de-la-machine&quot;&gt;Import de la machine&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Heureusement, il existe une &lt;a href=&quot;https://registry.terraform.io/providers/hashicorp/vsphere/latest/docs/resources/virtual_machine#importing&quot;&gt;commande dédiée&lt;/a&gt; pour demander à Terraform de réconcilier la VM déclarée et celle qui existe.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;listingblock&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Import d&amp;#8217;une machine existante&lt;/div&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;pre class=&quot;rouge highlight&quot;&gt;&lt;code data-lang=&quot;bash&quot;&gt;terraform import module.vm_preexistante.vsphere_virtual_machine.ubuntu_server_2004 /datacenter/vm/vm_preexistante&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Pour que cette commande fonctionne, quelques points d&amp;#8217;attention&amp;#160;:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;ulist&quot;&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;le nom &lt;code&gt;ubuntu_server_2004&lt;/code&gt; doit correspondre exactement à celui de la &lt;code&gt;resource&lt;/code&gt; Terraform déclarée dans le module&amp;#160;;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;le nom &lt;code&gt;datacenter&lt;/code&gt; est le nom réel du Datacenter VSphere, et non le nom qu&amp;#8217;on a donnée à la donnée Terraform &lt;code&gt;vsphere_datacenter&lt;/code&gt;&amp;#160;;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;le &lt;code&gt;/vm&lt;/code&gt; qui suit est une constante obligatoire&amp;#160;;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;le nom &lt;code&gt;vm_preexistante&lt;/code&gt; qui suit est le nom VSphere de la machine virtuelle existante (éventuellement précédé de son arborescence VSphere).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Un fois la machine importée, on vérifie via &lt;code&gt;terraform plan&lt;/code&gt; que Terraform ne prévoit plus de créer la machine virtuelle mais uniquement de la mettre à jour.
Si le plan nous convient, on l&amp;#8217;applique pour finaliser l&amp;#8217;opération&amp;#160;: la machine est maintenant gérée via Terraform.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;On peut ainsi migrer doucement l&amp;#8217;ensemble des machines qui existaient dans une gestion centralisée via Terraform&amp;#8230;&amp;#8203; pour plus facilement toutes les détruire en une seule commande.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</description>
        <pubDate>Thu, 11 Feb 2021 00:00:00 +0100</pubDate>
        <link>https://blog.courtine.org/2021/02/11/terraform-infra-vsphere-existante/</link>
        <guid isPermaLink="true">https://blog.courtine.org/2021/02/11/terraform-infra-vsphere-existante/</guid>
        
        <category>ops</category>
        
        
      </item>
    
      <item>
        <title>Déploiement du template VSphere avec Terraform</title>
        <description>&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Rappel&amp;#160;: dans &lt;a href=&quot;/2020/12/02/vsphere-template-ubuntu/&quot;&gt;l&amp;#8217;article précédent&lt;/a&gt;, nous avons vu comment créer un template &lt;a href=&quot;https://www.vmware.com/fr/products/vsphere.html&quot;&gt;VSphere&lt;/a&gt; pour &lt;a href=&quot;https://ubuntu.com/&quot;&gt;Ubuntu&lt;/a&gt; 20.04.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Maintenant, que nous avons le template et le fichier de &quot;post-configuration&quot;, nous aimerions automatiser son déploiement.
Or, il y a un outil pour ça&amp;#160;: &lt;a href=&quot;https://www.terraform.io/&quot;&gt;Terraform&lt;/a&gt;.
Si l&amp;#8217;outil a initialement été conçu pour provisionner des machines dans le cloud, il &lt;a href=&quot;https://registry.terraform.io/providers/hashicorp/vsphere/latest/docs&quot;&gt;supporte VSphere&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;admonitionblock important&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td class=&quot;icon&quot;&gt;
&lt;i class=&quot;fa icon-important&quot; title=&quot;Important&quot;&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class=&quot;content&quot;&gt;
Je renouvelle l&amp;#8217;avertissement de mon post précédent&amp;#160;: l&amp;#8217;administration système (et Terraform en particulier) n&amp;#8217;étant pas ma spécialité, il est possible que le script qui suit contienne des mauvaises pratiques.
N&amp;#8217;hésitez pas à me le signaler&amp;#160;: je corrigerai en conséquence.
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;admonitionblock warning&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td class=&quot;icon&quot;&gt;
&lt;i class=&quot;fa icon-warning&quot; title=&quot;Warning&quot;&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class=&quot;content&quot;&gt;
Pour utiliser le script qui suit, il est obligatoire d&amp;#8217;avoir assigné une adresse IP fixe au template de la machine virtuelle.
C&amp;#8217;est cette IP fixe qui permet dans la dernière partie du script de s&amp;#8217;y connecter pour injecter le script de configuration et l&amp;#8217;exécuter.
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;structure&quot;&gt;Structure&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Le code Terraform peut être assez redondant.
Nous allons donc mutualiser ce qui peut l&amp;#8217;être dans un &lt;a href=&quot;https://www.terraform.io/docs/configuration/modules.html&quot;&gt;module&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Voici la structure de notre projet&amp;#160;:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;listingblock&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;pre class=&quot;rouge highlight&quot;&gt;&lt;code&gt;- main.tf
- files
    - ubuntu20.04_config.sh
- modules
    - ubuntu20.04
        - main.tf&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;le-module&quot;&gt;Le module&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;listingblock&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Fichier modules/ubuntu20.04/main.tf&lt;/div&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;pre class=&quot;rouge highlight&quot;&gt;&lt;code data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;# Constantes &lt;/span&gt;&lt;i class=&quot;conum&quot; data-value=&quot;1&quot;&gt;&lt;/i&gt;&lt;b&gt;(1)&lt;/b&gt;
locals &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  vm_config_file &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;ubuntu20.04_config.sh&quot;&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;# Ces constantes ont été définies lors de l&apos;installation d&apos;Ubuntu, pour créer le template.&lt;/span&gt;
  vm_template_login      &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;admin&quot;&lt;/span&gt;
  vm_template_password   &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;my_secret_password&quot;&lt;/span&gt;
  vm_template_ip         &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;192.168.0.10&quot;&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Infrastructure VSphere.&lt;/span&gt;

provider &lt;span class=&quot;s2&quot;&gt;&quot;vsphere&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt; &lt;i class=&quot;conum&quot; data-value=&quot;2&quot;&gt;&lt;/i&gt;&lt;b&gt;(2)&lt;/b&gt;
  user &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;vsphere_user&quot;&lt;/span&gt;
  password &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;vsphere_password&quot;&lt;/span&gt;
  vsphere_server &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;vsphere_server&quot;&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

data &lt;span class=&quot;s2&quot;&gt;&quot;vsphere_datacenter&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;dc&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  name &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;datacenter&quot;&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

data &lt;span class=&quot;s2&quot;&gt;&quot;vsphere_datastore&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;ds&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  name          &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; var.vm_datastore
  datacenter_id &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; data.vsphere_datacenter.dc.id
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

data &lt;span class=&quot;s2&quot;&gt;&quot;vsphere_compute_cluster&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;cluster&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  name          &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;cluster&quot;&lt;/span&gt;
  datacenter_id &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; data.vsphere_datacenter.dc.id
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

data &lt;span class=&quot;s2&quot;&gt;&quot;vsphere_network&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;network&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  name          &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;vlan1&quot;&lt;/span&gt;
  datacenter_id &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; data.vsphere_datacenter.dc.id
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

data &lt;span class=&quot;s2&quot;&gt;&quot;vsphere_virtual_machine&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;ubuntu2004_template&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  name          &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;ubuntu20.04_template&quot;&lt;/span&gt;
  datacenter_id &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; data.vsphere_datacenter.dc.id
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Variables to configure VM. &lt;/span&gt;&lt;i class=&quot;conum&quot; data-value=&quot;3&quot;&gt;&lt;/i&gt;&lt;b&gt;(3)&lt;/b&gt;

variable &lt;span class=&quot;s2&quot;&gt;&quot;vm_hostname&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  description &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;VM hostname.&quot;&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;type&lt;/span&gt;        &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; string
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

variable &lt;span class=&quot;s2&quot;&gt;&quot;vm_ip&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  description &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;VM IP.&quot;&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;type&lt;/span&gt;        &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; string
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

variable &lt;span class=&quot;s2&quot;&gt;&quot;vm_num_cpus&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  description &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;VM CPUs.&quot;&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;type&lt;/span&gt;        &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; number
  default     &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 1
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

variable &lt;span class=&quot;s2&quot;&gt;&quot;vm_memory&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  description &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;VM memory (MB).&quot;&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;type&lt;/span&gt;        &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; number
  default     &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 2048
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

variable &lt;span class=&quot;s2&quot;&gt;&quot;vm_datastore&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  description &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;VM datastore.&quot;&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;type&lt;/span&gt;        &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; string
  default     &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;datastore1&quot;&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Déclaration des disques &lt;/span&gt;&lt;i class=&quot;conum&quot; data-value=&quot;4&quot;&gt;&lt;/i&gt;&lt;b&gt;(4)&lt;/b&gt;
variable &lt;span class=&quot;s2&quot;&gt;&quot;vm_disks&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  description &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;VM memory (MB).&quot;&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;type&lt;/span&gt;        &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; map&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;any&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
  default     &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    disk0 &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
      unit_number &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 0
      size &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 8 &lt;span class=&quot;c&quot;&gt;# Taille du template par défaut (en GB).&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Déclaration de la VM&lt;/span&gt;

resource &lt;span class=&quot;s2&quot;&gt;&quot;vsphere_virtual_machine&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;ubuntu_server_2004&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  name             &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; var.vm_hostname
  resource_pool_id &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; data.vsphere_compute_cluster.cluster.resource_pool_id
  datastore_id     &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; data.vsphere_datastore.ds.id
  guest_id         &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; data.vsphere_virtual_machine.ubuntu2004_template.guest_id
  scsi_type        &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; data.vsphere_virtual_machine.ubuntu2004_template.scsi_type

  num_cpus &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; var.vm_num_cpus
  memory   &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; var.vm_memory

  network_interface &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    network_id &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; data.vsphere_network.network.id
  &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

  &lt;span class=&quot;c&quot;&gt;# Configuration des disques &lt;/span&gt;&lt;i class=&quot;conum&quot; data-value=&quot;4&quot;&gt;&lt;/i&gt;&lt;b&gt;(4)&lt;/b&gt;
  dynamic &lt;span class=&quot;s2&quot;&gt;&quot;disk&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    for_each &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; var.vm_disks
    content &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
      label &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; disk.key
      size &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; disk.value.size
      unit_number &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; try&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;disk.value.unit_number, 0&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

  clone &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    template_uuid &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; data.vsphere_virtual_machine.ubuntu2004_template.id
  &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

  &lt;span class=&quot;c&quot;&gt;# Injection et exécution du script de post-configuration&lt;/span&gt;

  provisioner &lt;span class=&quot;s2&quot;&gt;&quot;file&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;source&lt;/span&gt;      &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;files/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;local&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.vm_config_file&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
    destination &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;/tmp/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;local&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.vm_config_file&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;

    connection &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nb&quot;&gt;type&lt;/span&gt;     &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;ssh&quot;&lt;/span&gt;
      host     &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; local.vm_template_ip
      user     &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; var.vm_template_login
      password &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; var.vm_template_password
    &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

  provisioner &lt;span class=&quot;s2&quot;&gt;&quot;remote-exec&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    inline &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;
      &lt;span class=&quot;s2&quot;&gt;&quot;chmod +x /tmp/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;local&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.vm_config_file&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;,
      &lt;span class=&quot;s2&quot;&gt;&quot;echo &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.vm_template_password&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; | sudo -S /tmp/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;local&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.vm_config_file&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.vm_hostname&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.vm_ip&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;,
      &lt;span class=&quot;s2&quot;&gt;&quot;rm -f /tmp/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;local&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.vm_config_file&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;,
      &lt;span class=&quot;s2&quot;&gt;&quot;echo &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.vm_template_password&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; | sudo -S netplan apply&quot;&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;

    connection &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nb&quot;&gt;type&lt;/span&gt;     &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;ssh&quot;&lt;/span&gt;
      host     &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; local.vm_template_ip
      user     &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; var.vm_template_login
      password &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; var.vm_template_password
    &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;colist arabic&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;&lt;i class=&quot;conum&quot; data-value=&quot;1&quot;&gt;&lt;/i&gt;&lt;b&gt;1&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;Les &lt;a href=&quot;https://www.terraform.io/docs/configuration/locals.html&quot;&gt;locals&lt;/a&gt; permettent d&amp;#8217;éviter les répétitions de constantes (ou de précalculer des valeurs en combinant des variables).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;i class=&quot;conum&quot; data-value=&quot;2&quot;&gt;&lt;/i&gt;&lt;b&gt;2&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;Pour simplifier le script, j&amp;#8217;ai mis les identifiants en dur.
Il est possible de les remplacer par des variables, pour éviter que les identifiants se retrouvent en gestion de configuration et/ou si on souhaite adresser de multiples instances VSphere.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;i class=&quot;conum&quot; data-value=&quot;3&quot;&gt;&lt;/i&gt;&lt;b&gt;3&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;Les &lt;a href=&quot;https://www.terraform.io/docs/configuration/variables.html&quot;&gt;variables&lt;/a&gt; permettent d&amp;#8217;injecter les éléments de configuration qui varient d&amp;#8217;une machine à l&amp;#8217;autre.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;i class=&quot;conum&quot; data-value=&quot;4&quot;&gt;&lt;/i&gt;&lt;b&gt;4&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;L&amp;#8217;utilisation d&amp;#8217;une map et d&amp;#8217;une boucle permet d&amp;#8217;affecter plusieurs disques à notre machine virtuelle en cas de besoin.&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;admonitionblock note&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td class=&quot;icon&quot;&gt;
&lt;i class=&quot;fa icon-note&quot; title=&quot;Note&quot;&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class=&quot;content&quot;&gt;
Ce module est assez simpliste.
Il est possible d&amp;#8217;externaliser plus de choses sous la forme de constantes/variables, pour prendre en compte une architecture VMWare plus complexes (multiples datacenters, clusters, réseaux, etc.)
Il est également possible d&amp;#8217;affecter plusieurs réseaux à une même machine, en utilisant la même technique que pour l&amp;#8217;affectation des disques.
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;la-déclaration-des-machines&quot;&gt;La déclaration des machines&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Le module étant créé, il ne reste plus qu&amp;#8217;à déclarer les machines dans le fichier principal &lt;code&gt;main.tf&lt;/code&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;listingblock&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Fichier main.tf&lt;/div&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;pre class=&quot;rouge highlight&quot;&gt;&lt;code data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;# Première VM, utilisant les valeurs par défaut du template.&lt;/span&gt;
module &lt;span class=&quot;s2&quot;&gt;&quot;vm1&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;source&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;./modules/ubuntu20.04&quot;&lt;/span&gt;

  vm_hostname &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;vm1&quot;&lt;/span&gt;
  vm_ip &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;192.168.0.11&quot;&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Utilisation des variables pour configurer les différents éléments.&lt;/span&gt;
module &lt;span class=&quot;s2&quot;&gt;&quot;vm2&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;source&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;./modules/ubuntu20.04&quot;&lt;/span&gt;

  vm_hostname &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;vm2&quot;&lt;/span&gt;
  vm_ip &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;192.168.0.12&quot;&lt;/span&gt;
  vm_num_cpus &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 2
  vm_memory &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 4096
  vm_datastore &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;datastore2&quot;&lt;/span&gt;
  vm_disks &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;disk0&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt; size &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 30 &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;disk1&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
      size &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 40
      unit_number &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 1
    &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;disk2&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
      size &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 50
      unit_number &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 2
    &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;le-déploiement&quot;&gt;Le déploiement&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Il n&amp;#8217;y a plus qu&amp;#8217;à exécuter et à laisser Terraform travailler&amp;#160;:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;listingblock&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;pre class=&quot;rouge highlight&quot;&gt;&lt;code data-lang=&quot;bash&quot;&gt;terraform init
terraform plan
terraform apply&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;conlusion&quot;&gt;Conlusion&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Terraform, c&amp;#8217;est un super-outil pour automatiser le déploiement de l&amp;#8217;infrastructure.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;admonitionblock warning&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td class=&quot;icon&quot;&gt;
&lt;i class=&quot;fa icon-warning&quot; title=&quot;Warning&quot;&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class=&quot;content&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;C&amp;#8217;est aussi un outil &quot;dangereux&quot;&amp;#160;: il ne sait pas gérer toutes les modifications d&amp;#8217;infrastructure &quot;en place&quot;, et en cas de modification d&amp;#8217;une machine, il va parfois procéder en la supprimant/recréant.
Or, tout le monde n&amp;#8217;est pas passé à l&amp;#8217;approche &lt;a href=&quot;https://www.hashicorp.com/resources/what-is-mutable-vs-immutable-infrastructure&quot;&gt;infrastructure immutable&lt;/a&gt;, où les machines n&amp;#8217;hébergent que du code et où les données sont attachées depuis l&amp;#8217;extérieur&amp;#8230;&amp;#8203;
Si on n&amp;#8217;y prête pas attention, on peut donc avoir vite fait de supprimer une machine hébergeant des données de production.&lt;/p&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;La machine ainsi mise à disposition étant &quot;nue&quot;, Il faut ensuite installer/configurer les serveurs/applications.
On pourra pour automatiser également cette partie utiliser par exemple &lt;a href=&quot;https://docs.ansible.com/ansible/latest/index.html&quot;&gt;Ansible&lt;/a&gt;, avec la suite de scripts &lt;a href=&quot;https://docs.debops.org/en/master/&quot;&gt;DebOps&lt;/a&gt; pour les serveurs basés sur Debian/Ubuntu.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</description>
        <pubDate>Tue, 08 Dec 2020 00:00:00 +0100</pubDate>
        <link>https://blog.courtine.org/2020/12/08/deploiement-vsphere-terraform/</link>
        <guid isPermaLink="true">https://blog.courtine.org/2020/12/08/deploiement-vsphere-terraform/</guid>
        
        <category>ops</category>
        
        <category>script</category>
        
        
      </item>
    
      <item>
        <title>Template Ubuntu 20.04 sur VSphere</title>
        <description>&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;problématique&quot;&gt;Problématique&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;On n&amp;#8217;a pas tous la chance de travailler dans une société qui déploie applications &lt;em&gt;serverless&lt;/em&gt; sur un cluster &lt;a href=&quot;https://kubernetes.io/fr/&quot;&gt;Kubernetes&lt;/a&gt; hébergé dans le cloud&amp;#8230;&amp;#8203;
Mais pour beaucoup de sociétés et de cas d&amp;#8217;utilisations, de bonnes vieilles machines virtuelles suffisent amplement à couvrir les besoins.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Le sujet auquel nous allons nous ateler est donc de créer un template &lt;a href=&quot;https://www.vmware.com/fr/products/vsphere.html&quot;&gt;VSphere&lt;/a&gt; pour simplifier le déploiement de machines virtuelles.
Normalement, ça ne devrait pas être un problème&amp;#160;: lorsqu&amp;#8217;on a créé un template de VM sur &lt;a href=&quot;https://www.vmware.com/fr/products/vsphere.html&quot;&gt;VSphere&lt;/a&gt;, on peut le configurer lorsqu&amp;#8217;on le déploie.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Mais voilà&amp;#8230;&amp;#8203; pour ça, il faut que le système d&amp;#8217;exploitation soit supporté par la version de VSphere qu&amp;#8217;on utilise.
Or, &lt;a href=&quot;https://ubuntu.com/&quot;&gt;Ubuntu&lt;/a&gt; (Server) 20.04 n&amp;#8217;est supporté qu&amp;#8217;à partir de &lt;a href=&quot;https://www.vmware.com/fr/products/vcenter-server.html&quot;&gt;vCenter&lt;/a&gt; 6.7U3g (avril 2020).
Si on n&amp;#8217;a un serveur VSphere à jour, ça va donc moins marcher&amp;#8230;&amp;#8203; et on n&amp;#8217;a pas toujours la main sur le serveur.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;admonitionblock important&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td class=&quot;icon&quot;&gt;
&lt;i class=&quot;fa icon-important&quot; title=&quot;Important&quot;&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class=&quot;content&quot;&gt;
Avant d&amp;#8217;aller plus loin, je précise que je ne suis pas du tout un spécialiste de l&amp;#8217;administration système.
Le contournement que je propose ci-après n&amp;#8217;est donc sans doute pas dans les règles de l&amp;#8217;art (mais je n&amp;#8217;ai pas trouvé mieux pour l&amp;#8217;instant).
N&amp;#8217;hésitez pas à me faire signe si vous avez de meilleures solutions.
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;le-template&quot;&gt;Le template&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Pour créer le template, nous allons simplement installer une VM Ubuntu manuellement, en faisant attention à certains points&amp;#160;:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;À l&amp;#8217;installation, on crée le disque de la plus petite taille dont on a besoin, en utilisant &lt;a href=&quot;https://doc.ubuntu-fr.org/lvm&quot;&gt;LVM&lt;/a&gt;, ce qui permettra de le redimensionner en fonction des besoins.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Après l&amp;#8217;installation, on applique les opérations indiquées dans &lt;a href=&quot;https://kb.vmware.com/s/article/54986&quot;&gt;cet article VMWare&lt;/a&gt;, en particulier la suppression de &lt;a href=&quot;https://cloudinit.readthedocs.io/en/latest/&quot;&gt;cloud-init&lt;/a&gt;, installé par défaut.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;listingblock&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Suppression de cloud-init et modification .&lt;/div&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;pre class=&quot;rouge highlight&quot;&gt;&lt;code data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt purge cloud-init
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt autoremove
&lt;span class=&quot;nb&quot;&gt;sudo rm&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-rf&lt;/span&gt; /etc/cloud
&lt;span class=&quot;nb&quot;&gt;sudo sed&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;s|D /tmp|#D /tmp|g&apos;&lt;/span&gt; /usr/lib/tmpfiles.d/tmp.conf&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;listingblock&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Modification du service /lib/systemd/system/open-vm-tools.service&lt;/div&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;pre class=&quot;rouge highlight&quot;&gt;&lt;code data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;# ...&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Unit]
&lt;span class=&quot;c&quot;&gt;# ...&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;After&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;dbus.service&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;admonitionblock warning&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td class=&quot;icon&quot;&gt;
&lt;i class=&quot;fa icon-warning&quot; title=&quot;Warning&quot;&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class=&quot;content&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Si on veut une configuration réseau de la machine en DHCP, il faut savoir qu&amp;#8217;Ubuntu ne présente pas par défaut l&amp;#8217;adresse MAC en réponse aux requêtes DHCP.
On peut immédiatement modifier ce comportement&amp;#160;:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;listingblock&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Fichier /etc/netplan/00-installer-config.yaml&lt;/div&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;pre class=&quot;rouge highlight&quot;&gt;&lt;code&gt;network:
  ethernets:
    ens192:
      dhcp4: true
      dhcp-identifier: mac
  version: 2&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Ces opérations effectuées, on peut convertir la machine virtuelle en template.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;déploiement-du-template&quot;&gt;Déploiement du template&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Comme on l&amp;#8217;a vu, lors du déploiement, on ne peut rien configurer si on n&amp;#8217;a pas un vCenter à jour.
Il va donc falloir configurer la VM manuellement, en effectuant un certain nombre d&amp;#8217;opérations&amp;#160;:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;sect2&quot;&gt;
&lt;h3 id=&quot;changement-du-nom-dhôte-de-la-machine&quot;&gt;Changement du nom d&amp;#8217;hôte de la machine&lt;/h3&gt;
&lt;div class=&quot;listingblock&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Changement du nom d&amp;#8217;hôte&lt;/div&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;pre class=&quot;rouge highlight&quot;&gt;&lt;code data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;hostnamectl set-hostname vm_new_hostname&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect2&quot;&gt;
&lt;h3 id=&quot;changement-des-clés-ssh-de-la-machine&quot;&gt;Changement des clés SSH de la machine&lt;/h3&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Si on a installé un serveur SSH lors de l&amp;#8217;installation Ubuntu, on régénère les clés SSH de la machine pour éviter qu&amp;#8217;elles soient identiques sur plusieurs machines distinctes.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;listingblock&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Régénération des clés SSH de la machine&lt;/div&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;pre class=&quot;rouge highlight&quot;&gt;&lt;code data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;rm&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; /etc/ssh/ssh_host_&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;
dpkg-reconfigure openssh-server
systemctl restart ssh&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect2&quot;&gt;
&lt;h3 id=&quot;changement-dadresse-ip&quot;&gt;Changement d&amp;#8217;adresse IP&lt;/h3&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Si on a choisi une IP fixe plutôt qu&amp;#8217;une configuration DHCP, la VM a été déployée avec l&amp;#8217;adresse IP définie pour le template.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;admonitionblock warning&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td class=&quot;icon&quot;&gt;
&lt;i class=&quot;fa icon-warning&quot; title=&quot;Warning&quot;&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class=&quot;content&quot;&gt;
On ne peut dans ce cas déployer qu&amp;#8217;une machine virtuelle à la fois (si on la configure en SSH).
Après changement de l&amp;#8217;adresse IP (ci-dessous), on peut déployer la machine suivante, etc.
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;listingblock&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Modification de l&amp;#8217;adresse IP&lt;/div&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;pre class=&quot;rouge highlight&quot;&gt;&lt;code data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;sudo sed&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;s|192.168.0.10/24|192.168.0.42/24|&quot;&lt;/span&gt; /etc/netplan/00-installer-config.yaml &lt;i class=&quot;conum&quot; data-value=&quot;1&quot;&gt;&lt;/i&gt;&lt;b&gt;(1)&lt;/b&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;netplan apply &lt;i class=&quot;conum&quot; data-value=&quot;2&quot;&gt;&lt;/i&gt;&lt;b&gt;(2)&lt;/b&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;colist arabic&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;&lt;i class=&quot;conum&quot; data-value=&quot;1&quot;&gt;&lt;/i&gt;&lt;b&gt;1&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;Adresse/masque à remplacer par les valeurs de votre choix.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;i class=&quot;conum&quot; data-value=&quot;2&quot;&gt;&lt;/i&gt;&lt;b&gt;2&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;Attention&amp;#160;: au moment de la configuration de l&amp;#8217;adresse IP définitive de la machine, la connexion SSH est coupée.&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect2&quot;&gt;
&lt;h3 id=&quot;redimentionnement-du-disque&quot;&gt;Redimentionnement du disque&lt;/h3&gt;
&lt;div class=&quot;admonitionblock note&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td class=&quot;icon&quot;&gt;
&lt;i class=&quot;fa icon-note&quot; title=&quot;Note&quot;&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class=&quot;content&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;On suppose ici qu&amp;#8217;on n&amp;#8217;a configuré à l&amp;#8217;installation qu&amp;#8217;un seul disque, avec le partitionnement LVM par défaut, soit&amp;#160;:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;ulist&quot;&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;/dev/sda1&lt;/code&gt; pour le bootloader&amp;#160;;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;/dev/sda2&lt;/code&gt; &lt;code&gt;/boot&lt;/code&gt;&amp;#160;;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;/dev/sda3&lt;/code&gt; &lt;code&gt;/&lt;/code&gt;&amp;#160;;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Si on a configuré la machine virtuelle avec plus d&amp;#8217;espace disque que le template, on doit affecter cet espace&amp;#160;.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;listingblock&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Création de /dev/sda4 avec l&amp;#8217;espace additionnel&lt;/div&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;pre class=&quot;rouge highlight&quot;&gt;&lt;code data-lang=&quot;bash&quot;&gt;fdisk /dev/sda
&lt;span class=&quot;c&quot;&gt;# Dans la console fdisk&lt;/span&gt;
n &lt;span class=&quot;c&quot;&gt;# Nouvelle partition&lt;/span&gt;
4 &lt;span class=&quot;c&quot;&gt;# Création de sda4 &lt;/span&gt;&lt;i class=&quot;conum&quot; data-value=&quot;1&quot;&gt;&lt;/i&gt;&lt;b&gt;(1)&lt;/b&gt;
&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# Début de l&apos;espace disponible (on laisse par défaut).&lt;/span&gt;
&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# Affecter tout l&apos;espace disponible (par défaut).&lt;/span&gt;
w &lt;span class=&quot;c&quot;&gt;# Écrire la nouvelle table des partitions&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;colist arabic&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;&lt;i class=&quot;conum&quot; data-value=&quot;1&quot;&gt;&lt;/i&gt;&lt;b&gt;1&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;À modifier si vous choisissez un partitionnement différent.
On peut également laisser vide pour laisser la valeur par défaut.&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;listingblock&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Redimentionnement LVM de la partition &apos;/&apos;&lt;/div&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;pre class=&quot;rouge highlight&quot;&gt;&lt;code data-lang=&quot;bash&quot;&gt;pvcreate /dev/sda4
vgextend ubuntu-vg /dev/sda4
lvextend &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt;+100%FREE /dev/ubuntu-vg/ubuntu-lv /dev/sda4
resize2fs /dev/ubuntu-vg/ubuntu-lv&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Là aussi, il faudra adapter le script si vous choisissez un partitionnement plus complexe.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;script-de-configuration&quot;&gt;Script de configuration&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;On aimerait maintenant éviter d&amp;#8217;effectuer pour chaque machine toutes ces opérations qui sont inutilement répétitives.
On crée donc un script de configuration, dont les seuls paramètres sont le nom d&amp;#8217;hôte de la machine et son adresse IP (cette partie étant inutile en DHCP).&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;listingblock&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Script complet de configuration&lt;/div&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;pre class=&quot;rouge highlight&quot;&gt;&lt;code data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;#!/bin/bash&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Script de configuration d&apos;une VM déployée à partir d&apos;un template Ubuntu Server.&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Le script doit être exécuté avec les droits d&apos;administration.&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;$#&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-ne&lt;/span&gt; 2 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then
 &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Usage: ubuntu_template_config.sh HOSTNAME ADRESSE_IP&quot;&lt;/span&gt;
 &lt;span class=&quot;nb&quot;&gt;exit &lt;/span&gt;1
&lt;span class=&quot;k&quot;&gt;fi

&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;DEST_HOSTNAME&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$1&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;DEST_IP&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$2&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;TEMPLATE_IP&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;192.168.0.10
&lt;span class=&quot;nv&quot;&gt;DNS_MASK&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;24

&lt;span class=&quot;c&quot;&gt;# Modification du nom de la machine.&lt;/span&gt;
hostnamectl set-hostname &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;DEST_HOSTNAME&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Modification de l&apos;adresse IP.&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sed&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;s|&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;TEMPLATE_IP&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;DNS_MASK&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;DEST_IP&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;DNS_MASK&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;|&quot;&lt;/span&gt; /etc/netplan/00-installer-config.yaml
&lt;span class=&quot;c&quot;&gt;# sudo netplan apply &lt;/span&gt;&lt;i class=&quot;conum&quot; data-value=&quot;1&quot;&gt;&lt;/i&gt;&lt;b&gt;(1)&lt;/b&gt;

&lt;span class=&quot;c&quot;&gt;# Régénération des clés SSH de la machine.&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;rm&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; /etc/ssh/ssh_host_&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;
dpkg-reconfigure openssh-server
systemctl restart ssh

&lt;span class=&quot;c&quot;&gt;# Modification de la taille du disque.&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Le template contient déjà les disques sda1 (grub), sda2 (&apos;/boot&apos;), et sda3 (&apos;/&apos; utilisant LVM).&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Si cette ligne est présente dans la sortie d&apos;erreur, cela signifie que le disque a été redimentionné avant déploiement du template.&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# On applique alors un redimentionnement LVM pour le prendre en compte.&lt;/span&gt;
fdisk &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt; /dev/sda 2&amp;gt;&amp;amp;1 | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;GPT PMBR size mismatch&quot;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$?&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-eq&lt;/span&gt; 0 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt;

  &lt;span class=&quot;c&quot;&gt;# Création de sda4 avec le disque manquant.&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;sed&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;s/\s*\([\+0-9a-zA-Z]*\).*/\1/&apos;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;EOF&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt; | fdisk /dev/sda
    n # Nouvelle partition
    4 # sda4
      # Début de l&apos;espace disponible
      # Fin de l&apos;espace disponible
    w # Écriture de la table des partitions
&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;EOF

&lt;/span&gt;  &lt;span class=&quot;c&quot;&gt;# Extension LVM.&lt;/span&gt;
  pvcreate /dev/sda4
  vgextend ubuntu-vg /dev/sda4
  lvextend &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt;+100%FREE /dev/ubuntu-vg/ubuntu-lv /dev/sda4
  resize2fs /dev/ubuntu-vg/ubuntu-lv
&lt;span class=&quot;k&quot;&gt;fi&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;colist arabic&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;&lt;i class=&quot;conum&quot; data-value=&quot;1&quot;&gt;&lt;/i&gt;&lt;b&gt;1&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;On ne reconfigure pas le service réseau immédiatement, car cela aurait pour effet d&amp;#8217;arrêter le script si celui-ci est exécuté via SSH.
Il ne faut donc pas oublier d&amp;#8217;appliquer manuellement la configuration &lt;code&gt;netplan&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;admonitionblock note&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td class=&quot;icon&quot;&gt;
&lt;i class=&quot;fa icon-note&quot; title=&quot;Note&quot;&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class=&quot;content&quot;&gt;
Ce script suppose un certain nombre de choses sur le template (partitionnement des disques, serveur SSH déjà installé, etc.). Il est bien évidemment à adapter en fonction des choix effectués lors de l&amp;#8217;installation.
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;le-mot-de-la-fin&quot;&gt;Le mot de la fin&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Ubuntu 20.04 n&amp;#8217;était évidemment qu&amp;#8217;un exemple.
On peut décliner cette méthode pour créer un script de &quot;post-configuration&quot; pour d&amp;#8217;autres distributions dont la configuration n&amp;#8217;est pas directement possible sur VSphere.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</description>
        <pubDate>Wed, 02 Dec 2020 00:00:00 +0100</pubDate>
        <link>https://blog.courtine.org/2020/12/02/vphere-template-ubuntu/</link>
        <guid isPermaLink="true">https://blog.courtine.org/2020/12/02/vphere-template-ubuntu/</guid>
        
        <category>ops</category>
        
        <category>script</category>
        
        
      </item>
    
      <item>
        <title>Vers Gitlab Pages en douceur</title>
        <description>&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;à-lorigine&quot;&gt;À l&amp;#8217;origine&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Dans &lt;a href=&quot;/2019/03/11/deploiement-gitlab/&quot;&gt;cet article&lt;/a&gt;, j&amp;#8217;expliquais comment ce blog est déployé automatiquement lors d&amp;#8217;un &lt;code&gt;git push&lt;/code&gt; via un script &lt;a href=&quot;https://docs.gitlab.com/ee/ci/&quot;&gt;Gitlab CI&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Et puis je suis tombé sur &lt;a href=&quot;https://k33g.gitlab.io/articles/2020-07-23-GITLAB-PAGES-EN.html&quot;&gt;ce tuto&lt;/a&gt; de &lt;a href=&quot;https://gitlab.com/k33g&quot;&gt;Philippe Charrière&lt;/a&gt;, où il explique comment déployer un blog statique sur &lt;a href=&quot;https://docs.gitlab.com/ee/user/project/pages/&quot;&gt;Gitlab Pages&lt;/a&gt;.
Bon&amp;#8230;&amp;#8203; c&amp;#8217;était juste avant de migrer vers &lt;a href=&quot;https://gitlab.com/k33g_org/k33g_org.gitlab.io/-/issues/1&quot;&gt;un blog à base de tickets Gilab&lt;/a&gt;.
Et même si je trouve le concept génial, je ne suis pas tout à fait près à franchir le pas.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;En revanche, le tuto m&amp;#8217;a bien donné envie d&amp;#8217;essayer de publier sur Gitlab Pages, et ce d&amp;#8217;autant plus que les sources sont déjà hébergées sur &lt;a href=&quot;https://gitlab.com/&quot;&gt;Gitlab&lt;/a&gt;.
À terme, cela pourrait me permettre de me passer de la &lt;a href=&quot;https://www.scaleway.com/fr/dedibox/&quot;&gt;Dedibox&lt;/a&gt; que j&amp;#8217;utilise actuellement pour l&amp;#8217;hébergement.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;mise-en-œuvre&quot;&gt;Mise en œuvre&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Par rapport au tuto, deux différences qui semblent faciles à contourner&amp;#160;:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;ulist&quot;&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;le blog n&amp;#8217;est pas directement constitué de pages, mais il est construit avec &lt;a href=&quot;https://jekyllrb.com/&quot;&gt;Jekyll&lt;/a&gt;&amp;#160;;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;il doit être déployé simultanément sur la Dedibox actuelle, et sur Gilab Pages (au moins dans un premier temps).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;sect2&quot;&gt;
&lt;h3 id=&quot;le-premier-essai-naïf&quot;&gt;Le premier essai naïf&lt;/h3&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Il semble y avoir très peu de choses à modifier par rapport à l&amp;#8217;ancienne version, et il s&amp;#8217;agit d&amp;#8217;ailleurs exclusivement de renommage&amp;#160;:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;ulist&quot;&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;l&amp;#8217;étape de construction doit s&amp;#8217;appeler &lt;code&gt;pages&lt;/code&gt; (et non &lt;code&gt;build&lt;/code&gt; ou autre chose)&amp;#160;;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;le site doit être construit dans le répertoire &lt;code&gt;public&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;admonitionblock warning&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td class=&quot;icon&quot;&gt;
&lt;i class=&quot;fa icon-warning&quot; title=&quot;Warning&quot;&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class=&quot;content&quot;&gt;
Divulgâchis&amp;#160;: ne vous précipitez pas sur cette première version&amp;#8230;&amp;#8203; elle ne fonctionne pas comme prévu.
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;listingblock&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Premier essai de configuration &quot;.gitlab-ci.yml&quot;&lt;/div&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;pre class=&quot;rouge highlight&quot;&gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;na&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;ruby:2.6&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;stages&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;pages&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;deploy&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;variables&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;JEKYLL_ENV&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;production&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;LC_ALL&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;C.UTF-8&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;cache&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;paths&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/vendor&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;before_script&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;gem install bundler&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;which&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;ssh-agent&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;||&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;apt-get&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;update&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-y&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;apt-get&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;openssh-client&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-y&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;)&apos;&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;pages&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;stage&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;pages&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;bundle install --path=/vendor&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;bundle exec jekyll build -d public&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;artifacts&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;paths&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;public&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;only&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;master&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;deploy&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;stage&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;deploy&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;eval $(ssh-agent -s)&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;echo &quot;$SSH_PRIVATE_KEY&quot; | ssh-add -&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;scp&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-o&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;StrictHostKeyChecking=no&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-o&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;UserKnownHostsFile=/dev/null&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-r&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;$BLOG_USER@$BLOG_SERVER:~/blog/&quot;&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;dependencies&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;pages&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;only&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;master&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect2&quot;&gt;
&lt;h3 id=&quot;le-problème&quot;&gt;Le problème&lt;/h3&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Techniquement, ça se déploie bien.
En revanche, tous les liens du site sur Gitlab Pages sont cassés, et le résultat est inutilisable.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Celà vient du fait que les pages sont déployées à l&amp;#8217;adresse &lt;code&gt;&lt;a href=&quot;https://bcourtine.gitlab.io&quot; class=&quot;bare&quot;&gt;https://bcourtine.gitlab.io&lt;/a&gt;&lt;strong&gt;/blog&lt;/strong&gt;/&lt;/code&gt;, alors que le site autohébergé est servi à l&amp;#8217;adresse &lt;code&gt;&lt;a href=&quot;https://blog.courtine.org/&quot; class=&quot;bare&quot;&gt;https://blog.courtine.org/&lt;/a&gt;&lt;/code&gt; sans préfixe.
Et je ne sais pas s&amp;#8217;il est possible de modifier facilement ce point pour héberger directement à l&amp;#8217;adresse &lt;code&gt;&lt;a href=&quot;https://bcourtine.gitlab.io/&quot; class=&quot;bare&quot;&gt;https://bcourtine.gitlab.io/&lt;/a&gt;&lt;/code&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Pour y remédier, nous allons donc jouer avec les templates Jekyll&amp;#160;:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;ulist&quot;&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;on ajoute au fichier &lt;code&gt;_config.yml&lt;/code&gt; une propriété &lt;code&gt;baseurl&lt;/code&gt; (si elle n&amp;#8217;existe pas encore)&amp;#160;;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;on n&amp;#8217;oublie pas de la prendre en compte également dans les variables Asciidoc du fichier&amp;#160;;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;on vérifie que les liens dans les templates Jekyll sont tous bien préfixés par cette variable (par exemple &lt;code&gt;{{ post.url | prepend: site.baseurl }}&lt;/code&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;listingblock&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Extrait de _config.yml&lt;/div&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;pre class=&quot;rouge highlight&quot;&gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# ...&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;baseurl&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&apos;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# &apos;/blog&apos; pour Gitlab Pages&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;https://blog.courtine.org&apos;&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;permalink&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/:year/:month/:day/:title/&apos;&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;jsdir&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/js&apos;&lt;/span&gt; &lt;i class=&quot;conum&quot; data-value=&quot;1&quot;&gt;&lt;/i&gt;&lt;b&gt;(1)&lt;/b&gt;
&lt;span class=&quot;na&quot;&gt;stylesdir&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/css&apos;&lt;/span&gt; &lt;i class=&quot;conum&quot; data-value=&quot;2&quot;&gt;&lt;/i&gt;&lt;b&gt;(2)&lt;/b&gt;
&lt;span class=&quot;na&quot;&gt;imagesdir&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/images&apos;&lt;/span&gt; &lt;i class=&quot;conum&quot; data-value=&quot;2&quot;&gt;&lt;/i&gt;&lt;b&gt;(2)&lt;/b&gt;

&lt;span class=&quot;na&quot;&gt;asciidoctor&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;base_dir&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;:docdir&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;attributes&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;imagesdir&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;{site.baseurl}/images&apos;&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;iconsdir&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;{site.imagesdir}/icons&apos;&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;stylesdir&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;{site.baseurl}/css&apos;&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# ...&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;colist arabic&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;&lt;i class=&quot;conum&quot; data-value=&quot;1&quot;&gt;&lt;/i&gt;&lt;b&gt;1&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;À utiliser dans les templates sous la forme &lt;code&gt;{{ site.jsdir | prepend: site.baseurl }}&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;i class=&quot;conum&quot; data-value=&quot;2&quot;&gt;&lt;/i&gt;&lt;b&gt;2&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;Idem.&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Comme ces variables sont évaluées au moment de la construction du site par Jekyll, on n&amp;#8217;a pas le choix de construire deux fois le blog, en modifiant les variables entre les deux constructions.
Un simple &lt;code&gt;sed&lt;/code&gt; fait l&amp;#8217;affaire pour ça.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Voici donc la configuration Gitlab qui marche pour mon cas d&amp;#8217;utilisation.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;listingblock&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Configuration &quot;.gitlab-ci.yml&quot; fonctionnelle&lt;/div&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;pre class=&quot;rouge highlight&quot;&gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;na&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;ruby:2.6&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;stages&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;pages&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;deploy&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;variables&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;JEKYLL_ENV&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;production&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;LC_ALL&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;C.UTF-8&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;cache&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;paths&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/vendor&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;before_script&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;gem install bundler&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;which&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;ssh-agent&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;||&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;apt-get&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;update&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-y&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;apt-get&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;openssh-client&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-y&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;)&apos;&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;pages&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;stage&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;pages&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;bundle install --path=/vendor&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;# Build for https://blog.courtine.org/&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;bundle exec jekyll build -d _site&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;# Replace url and build for Gitlab Pages&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;sed&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-i&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;s|^url:.*|url:&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&apos;https://bcourtine.gitlab.io&apos;|&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;_config.yml&quot;&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;sed&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-i&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;s|^baseurl:.*|baseurl:&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&apos;/blog&apos;|&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;_config.yml&quot;&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;bundle exec jekyll build -d public&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;artifacts&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;paths&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;_site&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;public&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;only&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;master&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;deploy&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;stage&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;deploy&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;eval $(ssh-agent -s)&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;echo &quot;$SSH_PRIVATE_KEY&quot; | ssh-add -&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;scp&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-o&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;StrictHostKeyChecking=no&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-o&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;UserKnownHostsFile=/dev/null&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-r&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;_site&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;$BLOG_USER@$BLOG_SERVER:~/blog/&quot;&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;dependencies&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;pages&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;only&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;master&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;admonitionblock tip&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td class=&quot;icon&quot;&gt;
&lt;i class=&quot;fa icon-tip&quot; title=&quot;Tip&quot;&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class=&quot;content&quot;&gt;
Il faut bien penser à mettre à jour la visibilité des pages pour rendre le site public si le dépôt est privé (les pages sont également privées par défaut dans ce cas).
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;google-analytics&quot;&gt;Google analytics&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;J&amp;#8217;utilise &lt;a href=&quot;https://analytics.google.com/&quot;&gt;Google Analytics&lt;/a&gt; pour connaître la fréquentation (ridicule) du blog, et les articles les plus consultés.
Or, avec ce double déploiement, les pages &lt;code&gt;/article&lt;/code&gt; et &lt;code&gt;/blog/article&lt;/code&gt; sont référencées de manière distincte, là où je voudrais un comptage unique des consultations.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Mais Google Analytics a une manière élégante de résoudre ce problème.
Dans &lt;code&gt;Admin &amp;gt; All Filters&lt;/code&gt;, il est possible d&amp;#8217;ajouter des filtres.
Nous créons donc un filtre de type &lt;code&gt;Custom &amp;gt; Search and Replace&lt;/code&gt;&amp;#160;: sur le champ &lt;code&gt;Request URI&lt;/code&gt;, on remplace &lt;code&gt;/blog/&lt;/code&gt; par &lt;code&gt;/&lt;/code&gt; et le tour est joué.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Avec finalement peu d&amp;#8217;efforts, tout marche comme on veut&amp;#160;: merci Philippe&amp;#160;!&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;admonitionblock note&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td class=&quot;icon&quot;&gt;
&lt;i class=&quot;fa icon-note&quot; title=&quot;Note&quot;&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class=&quot;content&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Lors de cette opération, j&amp;#8217;ai fait un passage en revue des templates (j&amp;#8217;avais parfois été fainéant en omettant le filtre &lt;code&gt;prepend&lt;/code&gt;).
J&amp;#8217;en ai profité pour nettoyer un peu et ne garder que le minimum&amp;#160;:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;ulist&quot;&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Suppression de &lt;a href=&quot;https://disqus.com/&quot;&gt;Disqus&lt;/a&gt;, qui était très peu utilisé&amp;#160;;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Suppression des liens de partage sur les réseaux sociaux, pour la même raison&amp;#160;;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Je n&amp;#8217;ai conservé qu&amp;#8217;un &lt;a href=&quot;https://analytics.google.com/&quot;&gt;Google Analytics&lt;/a&gt; (anonymisé)&amp;#8230;&amp;#8203; mais je le consulte tellement peu que je songe à le supprimer également.&lt;/p&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</description>
        <pubDate>Mon, 30 Nov 2020 00:00:00 +0100</pubDate>
        <link>https://blog.courtine.org/2020/11/30/gitlab-pages/</link>
        <guid isPermaLink="true">https://blog.courtine.org/2020/11/30/gitlab-pages/</guid>
        
        <category>perso</category>
        
        <category>jekyll</category>
        
        <category>script</category>
        
        
      </item>
    
      <item>
        <title>Bureau de télétravail</title>
        <description>&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;en-image&quot;&gt;En image&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;imageblock text-center&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;a class=&quot;image&quot; href=&quot;/images/bureau.jpg&quot;&gt;&lt;img src=&quot;/images/bureau.jpg&quot; alt=&quot;Bureau&quot;&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;en-détail&quot;&gt;En détail&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Depuis maintenant presque un an, avec &lt;a href=&quot;https://fr.wikipedia.org/wiki/Pand%C3%A9mie_de_Covid-19&quot;&gt;la Covid-19&lt;/a&gt;, le télétravail est devenu la norme (même si j&amp;#8217;en faisais ponctuellement avant).
Et pour travailler dans de bonnes conditions, voici le matériel en détail&amp;#160;:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;ulist&quot;&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Un fauteuil &quot;gaming&quot; réglable.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Un meuble de récupération&amp;#8230;&amp;#8203; je suis incapable d&amp;#8217;en donner sa référence.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Un pot de crayons (et du papier dans le tiroir)&amp;#160;: je n&amp;#8217;ai encore rien trouvé de mieux pour réfléchir&amp;#8230;&amp;#8203;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Trois écrans (dont deux &lt;a href=&quot;https://fr.wikipedia.org/wiki/Quad_HDTV&quot;&gt;QHD&lt;/a&gt;).
Le dernier est arrivé récemment&amp;#160;: il devait à l&amp;#8217;origine remplacer l&amp;#8217;écran Full-HD&amp;#8230;&amp;#8203; mais ma carte graphique ayant trois sorties vidéo, j&amp;#8217;ai finalement gardé les trois.
Ce n&amp;#8217;est pas indispensable, mais on y trouve vite un intérêt.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Un ordinateur (fixe&amp;#160;!) sous &lt;a href=&quot;https://linuxmint.com/&quot;&gt;Linux Mint&lt;/a&gt;.
Au travail, nous sommes aussi sur des postes fixes&amp;#160;: je travaille donc en synchronisant les éléments sur lesquels je travaille (via &lt;a href=&quot;https://git-scm.com/&quot;&gt;git&lt;/a&gt; essentiellement).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;admonitionblock tip&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td class=&quot;icon&quot;&gt;
&lt;i class=&quot;fa icon-tip&quot; title=&quot;Tip&quot;&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class=&quot;content&quot;&gt;
J&amp;#8217;ai un PC portable &lt;a href=&quot;https://www.dell.com/&quot;&gt;Dell&lt;/a&gt; (également sous Mint), sur lequel tous mes outils de développement sont installés et prêts à l&amp;#8217;emploi&amp;#8230;&amp;#8203; mais en pratique, je l&amp;#8217;utilise beaucoup plus rarement.
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Pour la communication&amp;#160;:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;ulist&quot;&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Une webcam &lt;a href=&quot;https://www.logitech.fr/fr-fr/product/hd-pro-webcam-c920&quot;&gt;Logitech C920&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Un micro &lt;a href=&quot;https://www.bluemic.com/fr-fr/products/yeti/&quot;&gt;Blue Yeti&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Un casque &lt;a href=&quot;https://www.bose.fr/fr_fr/products/headphones/over_ear_headphones/quietcomfort-35-wireless-ii.html&quot;&gt;Bose QC 35 II&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Un DAC &lt;a href=&quot;https://www.son-video.com/article/baladeurs-audiophiles/fiio/x3-ii-noir&quot;&gt;Fiio X3 II&lt;/a&gt; (bien plus pour la musique que pour les visioconférences).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Une lampe à orientation/éclairage variable (pour l&amp;#8217;éclairage en visioconférence).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Les accessoires&amp;#160;:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;ulist&quot;&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Une souris ergonomique (d&amp;#8217;une marque inconnue)&amp;#160;: avant de découvrir, j&amp;#8217;étais sujet à des douleurs/tendinites qui ont complètement disparu depuis.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Un clavier &lt;a href=&quot;https://www.logitechg.com/fr-fr/products/gaming-keyboards/g910-orion-spectrum-rgb-gaming-keyboard.html&quot;&gt;Logitech G910&lt;/a&gt;.
J&amp;#8217;aime le toucher d&amp;#8217;un clavier mécanique, et les &quot;touches macro&quot; peuvent facilement être mises à profit pour les raccourcis de programmes ou raccourcis de développements.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Un switch USB avec interrupteurs (permettant d&amp;#8217;allumer/éteindre la webcam le micro, etc. sans avoir besoin de les débrancher).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;admonitionblock note&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td class=&quot;icon&quot;&gt;
&lt;i class=&quot;fa icon-note&quot; title=&quot;Note&quot;&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class=&quot;content&quot;&gt;
L&amp;#8217;air de rien, ces petits accessoires augmentent nettement le confort de travail.
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;ressenti&quot;&gt;Ressenti&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Le meuble qui est l&amp;#8217;élément principal que je souhaiterait remplacer dans cette installation&amp;#160;:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;ulist&quot;&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Les placards latéraux ne me servent pas au quotidien, et laissent peu de place sur les jambes.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Le bureau n&amp;#8217;est pas réglable en hauteur (et ne me permet donc pas de tester le &quot;développement debout&quot;).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Cependant, je reste satisfait de cette installation, et j&amp;#8217;y travaille confortablement.
En particulier, j&amp;#8217;apprécie bien l&amp;#8217;espace surélevé sur le bureau qui met les écrans à bonne hauteur.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</description>
        <pubDate>Thu, 26 Nov 2020 00:00:00 +0100</pubDate>
        <link>https://blog.courtine.org/2020/11/26/bureau/</link>
        <guid isPermaLink="true">https://blog.courtine.org/2020/11/26/bureau/</guid>
        
        <category>perso</category>
        
        
      </item>
    
      <item>
        <title>Le calendrier cinéma vu du front</title>
        <description>&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;la-problématique&quot;&gt;La problématique&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Les semaines cinéma en France démarrent le mercredi, jour de sortie en salle des nouveaux films.
Ce problème a déjà été expliqué &lt;a href=&quot;/2017/02/12/calendrier-cinema-java8/&quot;&gt;dans cet article&lt;/a&gt;, et traité en java.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Mais il n&amp;#8217;y a pas que le java dans la vie… et on a le même besoin pour la partie frontend de nos applications.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;le-code-historique&quot;&gt;Le code historique&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Nous avons longtemps traité ce problème avec du code utilitaire, basé sur les objets &lt;code&gt;Date&lt;/code&gt;, en javascript et plus récemment en typescript (les algorithmes étant identiques à ceux que nous utilisions en java, avant la migration Java 8).&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;listingblock&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Quelques méthodes historiques&lt;/div&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;pre class=&quot;rouge highlight&quot;&gt;&lt;code data-lang=&quot;typescript&quot;&gt;&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;getSemaineCinema&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;date&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;Date&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt; &lt;span class=&quot;kr&quot;&gt;number&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;cm&quot;&gt;/* ... */&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;getAnneeCinema&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;date&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;Date&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt; &lt;span class=&quot;kr&quot;&gt;number&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;cm&quot;&gt;/* ... */&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;getPremierJourAnneeCinema&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;annee&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kr&quot;&gt;number&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;Date&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;cm&quot;&gt;/* ... */&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;getPremierJourSemaineCinema&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;date&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;Date&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;Date&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;cm&quot;&gt;/* ... */&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// etc.&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;moment-js-à-la-rescousse&quot;&gt;Moment.js à la rescousse&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;&lt;a href=&quot;https://momentjs.com/&quot;&gt;Moment.js&lt;/a&gt;, c&amp;#8217;est le &lt;a href=&quot;https://www.joda.org/joda-time/&quot;&gt;Joda-Time&lt;/a&gt; du monde JS.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Or, il permet de définir une locale personnalisée… dont un champ &quot;weeks&quot;, composé des deux valeurs qui correspondent aux possibilités de configuration de la classe &lt;code&gt;WeekFields&lt;/code&gt; utilisée en Java 8 (et supérieur).&amp;#160;:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;listingblock&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;pre class=&quot;rouge highlight&quot;&gt;&lt;code data-lang=&quot;typescript&quot;&gt;&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;configureFrCineLocale&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;moment&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;defineLocale&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;fr_cine&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;week&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;dow&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;i class=&quot;conum&quot; data-value=&quot;1&quot;&gt;&lt;/i&gt;&lt;b&gt;(1)&lt;/b&gt;
      &lt;span class=&quot;na&quot;&gt;doy&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;i class=&quot;conum&quot; data-value=&quot;2&quot;&gt;&lt;/i&gt;&lt;b&gt;(2)&lt;/b&gt;
    &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;months&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;Janvier&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;Février&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;cm&quot;&gt;/* ... */&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;monthsShort&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;Jan&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;Fév&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;cm&quot;&gt;/* ... */&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;weekdays&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;Dimanche&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;Lundi&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;cm&quot;&gt;/* ... */&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;i class=&quot;conum&quot; data-value=&quot;3&quot;&gt;&lt;/i&gt;&lt;b&gt;(3)&lt;/b&gt;
    &lt;span class=&quot;na&quot;&gt;weekdaysShort&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;Dim&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;Lun&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;cm&quot;&gt;/* ... */&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;i class=&quot;conum&quot; data-value=&quot;3&quot;&gt;&lt;/i&gt;&lt;b&gt;(3)&lt;/b&gt;
    &lt;span class=&quot;na&quot;&gt;weekdaysMin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;Di&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;Lu&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;cm&quot;&gt;/* ... */&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;i class=&quot;conum&quot; data-value=&quot;3&quot;&gt;&lt;/i&gt;&lt;b&gt;(3)&lt;/b&gt;
    &lt;span class=&quot;c1&quot;&gt;// ...&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;

  &lt;span class=&quot;nx&quot;&gt;moment&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;locale&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;fr_cine&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;colist arabic&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;&lt;i class=&quot;conum&quot; data-value=&quot;1&quot;&gt;&lt;/i&gt;&lt;b&gt;1&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;Jour de la semaine débutant la semaine, ici le mercredi.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;i class=&quot;conum&quot; data-value=&quot;2&quot;&gt;&lt;/i&gt;&lt;b&gt;2&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;Jour de la semaine qui doit être dans l&amp;#8217;année courante.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;i class=&quot;conum&quot; data-value=&quot;3&quot;&gt;&lt;/i&gt;&lt;b&gt;3&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;Attention à ne pas oublier que les libellés des jours commencent au dimanche.&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;admonitionblock warning&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td class=&quot;icon&quot;&gt;
&lt;i class=&quot;fa icon-warning&quot; title=&quot;Warning&quot;&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class=&quot;content&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Initialement, nous avions interprété &lt;code&gt;doy&lt;/code&gt; comme le &quot;nombre de jours de la semaine dans l&amp;#8217;année courante&quot;, comme dans l&amp;#8217;API Java.
Mais l&amp;#8217;API Moment.js fonctionne différemment&amp;#160;: l&amp;#8217;année de la semaine cinéma doit contenir le jour &lt;code&gt;7 + dow - doy&lt;/code&gt; (cf. &lt;a href=&quot;https://momentjscom.readthedocs.io/en/latest/moment/07-customization/16-dow-doy/&quot;&gt;documentation&lt;/a&gt;).
Comme l&amp;#8217;année cinéma de la semaine doit contenir le 4 janvier et commencer un mercredi, on obtient &lt;code&gt;doy = 6&lt;/code&gt; (4&amp;#160;=&amp;#160;7&amp;#160;+&amp;#160;3&amp;#160;-&amp;#160;6).&lt;/p&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Une fois cette locale définie et configurée, Moment.js fournit toutes les méthodes permettant d&amp;#8217;obtenir les valeurs que l&amp;#8217;on souhaite (semaine et année cinéma d&amp;#8217;une date donnée, etc.).&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Toutes les méthodes de notre librairie maison, ont ainsi presque toutes été réduites à une ligne.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;bonus-linterface-graphique&quot;&gt;Bonus&amp;#160;: l&amp;#8217;interface graphique&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Si nous utilisons du code JS, c&amp;#8217;est essentiellement pour aboutir à des interfaces web.
Le code que nous développons pour nos nouveaux besoins repose principalement sur &lt;a href=&quot;https://fr.reactjs.org/&quot;&gt;React&lt;/a&gt;, ainsi que les bibliothèques de composant &lt;a href=&quot;https://ant.design/&quot;&gt;Ant Design&lt;/a&gt;.
Or, celle-ci dispose de composants &lt;code&gt;DatePicker&lt;/code&gt;/&lt;code&gt;WeekPicker&lt;/code&gt; reposant sur &lt;code&gt;Moment.js&lt;/code&gt;, et sur sa locale configurée.
Ainsi, sans autre développement que la configuration ci-dessus, nous obtenons par exemple un &lt;code&gt;WeekPicker&lt;/code&gt; qui est un &quot;&lt;em&gt;Semaine cinéma picker&lt;/em&gt;&quot;, correspondant très bien à nos besoins.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;imageblock text-center&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;a class=&quot;image&quot; href=&quot;/images/js/semaine_cinema_picker.png&quot;&gt;&lt;img src=&quot;/images/js/semaine_cinema_picker.png&quot; alt=&quot;Semaine cinéma picker&quot;&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</description>
        <pubDate>Tue, 17 Sep 2019 00:00:00 +0200</pubDate>
        <link>https://blog.courtine.org/2019/09/17/calendrier-cinema-frontend/</link>
        <guid isPermaLink="true">https://blog.courtine.org/2019/09/17/calendrier-cinema-frontend/</guid>
        
        <category>javascript</category>
        
        
      </item>
    
      <item>
        <title>Déploiement du blog avec Gitlab-CI</title>
        <description>&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;au-début&quot;&gt;Au début&amp;#8230;&amp;#8203;&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;La première version de ce blog statique était mise en production manuellement&amp;#160;:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;ulist&quot;&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Construction et test du site en local, sur ma machine de développement.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Déploiement du site construit via &lt;code&gt;rsync&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Pour les besoins d&amp;#8217;un blog perso, ça suffit amplement.
Cependant, ce blog servant également à faire des tests, je voulus aller plus loin.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;déploiement-continu-v1&quot;&gt;Déploiement continu V1&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Ce blog étant initialement hébergé sur un beau serveur dédié &lt;a href=&quot;https://console.online.net/fr/order/server&quot;&gt;Dedibox&lt;/a&gt;, il y avait la place pour d&amp;#8217;autres services.
Entre autres, &lt;a href=&quot;https://gitorious.org/&quot;&gt;Gitorious&lt;/a&gt; et &lt;a href=&quot;https://jenkins.io/&quot;&gt;Jenkins&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;La premier script de déploiement continu fut donc l&amp;#8217;occasion de tester (et d&amp;#8217;approuver) les &lt;a href=&quot;https://jenkins.io/doc/book/pipeline/&quot;&gt;&lt;em&gt;pipelines&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Plus tard, le code fut migré vers &lt;a href=&quot;https://bitbucket.org/&quot;&gt;Bitbucket&lt;/a&gt;, un des premiers hébergeurs à proposer des dépôts privés gratuitement.
Le &lt;em&gt;pipeline&lt;/em&gt; de déploiement a été conservé sur Jenkins.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;vers-gitlab&quot;&gt;Vers Gitlab&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;D&amp;#8217;autres offres existent&amp;#160;:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;ulist&quot;&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;La dernière en date, &lt;a href=&quot;https://github.com/&quot;&gt;Github&lt;/a&gt; propose depuis peu des dépôt privés gratuits.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://www.gitlab.com/&quot;&gt;Gitlab&lt;/a&gt; également, &lt;strong&gt;avec en plus 2000 heures mensuelles de calcul sur des instances Gitlab Runner partagées&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;C&amp;#8217;est cette dernière option qui m&amp;#8217;a convaincu de migrer l&amp;#8217;hébergement des sources du blog.
Elle m&amp;#8217;a également fourni un remplaçant plus simple au &lt;em&gt;pipeline&lt;/em&gt; Jenkins de déploiement continu.
L&amp;#8217;existence de ce remplaçant a aidé à la décision d&amp;#8217;abandonner la Dédibox.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Il ne restait plus qu&amp;#8217;à écrire le script de déploiement &lt;code&gt;.gitlab-ci.yml&lt;/code&gt;.
Je me suis pour cela inspiré de &lt;a href=&quot;https://docs.gitlab.com/ee/ci/README.html&quot;&gt;la documentation&lt;/a&gt; et des posts de &lt;a href=&quot;https://medium.com/@k33g_org&quot;&gt;Philippe Charrière&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;listingblock&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Déploiement continu d&amp;#8217;un site Jekyll via SSH&lt;/div&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;pre class=&quot;rouge highlight&quot;&gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;na&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;ruby:2.6&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;stages&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;build&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;deploy&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;variables&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;JEKYLL_ENV&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;production&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;LC_ALL&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;C.UTF-8&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;cache&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;i class=&quot;conum&quot; data-value=&quot;1&quot;&gt;&lt;/i&gt;&lt;b&gt;(1)&lt;/b&gt;
  &lt;span class=&quot;na&quot;&gt;paths&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/vendor&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;before_script&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;gem install bundler&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;which&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;ssh-agent&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;||&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;apt-get&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;update&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-y&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;apt-get&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;openssh-client&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-y&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;)&apos;&lt;/span&gt; &lt;i class=&quot;conum&quot; data-value=&quot;2&quot;&gt;&lt;/i&gt;&lt;b&gt;(2)&lt;/b&gt;

&lt;span class=&quot;na&quot;&gt;build&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;stage&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;build&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;bundle install --path=/vendor&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;bundle exec jekyll build -d blog&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;artifacts&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;i class=&quot;conum&quot; data-value=&quot;3&quot;&gt;&lt;/i&gt;&lt;b&gt;(3)&lt;/b&gt;
    &lt;span class=&quot;na&quot;&gt;paths&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;blog&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;deploy&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;stage&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;deploy&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;mkdir .ssh&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;chmod 700 .ssh&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;echo $KNOWN_HOSTS &amp;gt; .ssh/known_hosts&lt;/span&gt; &lt;i class=&quot;conum&quot; data-value=&quot;4&quot;&gt;&lt;/i&gt;&lt;b&gt;(4)&lt;/b&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;eval $(ssh-agent -s)&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;echo &quot;$SSH_PRIVATE_KEY&quot; | ssh-add -&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;scp&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-r&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;blog&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;$BLOG_USER@$BLOG_SERVER:&quot;&lt;/span&gt; &lt;i class=&quot;conum&quot; data-value=&quot;5&quot;&gt;&lt;/i&gt;&lt;b&gt;(5)&lt;/b&gt;
  &lt;span class=&quot;na&quot;&gt;dependencies&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;i class=&quot;conum&quot; data-value=&quot;3&quot;&gt;&lt;/i&gt;&lt;b&gt;(3)&lt;/b&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;build&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;only&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;master&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;colist arabic&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;&lt;i class=&quot;conum&quot; data-value=&quot;1&quot;&gt;&lt;/i&gt;&lt;b&gt;1&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;L&amp;#8217;utilisation du cache permet de conserver les gems d&amp;#8217;un build au suivant.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;i class=&quot;conum&quot; data-value=&quot;2&quot;&gt;&lt;/i&gt;&lt;b&gt;2&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;Précaution non nécessaire pour cette image, qui contient déjà &lt;code&gt;ssh-agent&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;i class=&quot;conum&quot; data-value=&quot;3&quot;&gt;&lt;/i&gt;&lt;b&gt;3&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;La déclaration d&amp;#8217;un &lt;strong&gt;artefact&lt;/strong&gt; dans une étape de build permet de réutiliser celui-ci dans une étape ultérieure, via une &lt;strong&gt;dépendance&lt;/strong&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;i class=&quot;conum&quot; data-value=&quot;4&quot;&gt;&lt;/i&gt;&lt;b&gt;4&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;Utilisation des &lt;strong&gt;secrets&lt;/strong&gt; Gitlab&amp;#160;: les variables définies dans le projet sont injectées lors de l&amp;#8217;exécution du script.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;i class=&quot;conum&quot; data-value=&quot;5&quot;&gt;&lt;/i&gt;&lt;b&gt;5&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;rsync&lt;/code&gt; est plus adapté, mais n&amp;#8217;est pas installé par défaut dans l&amp;#8217;image &lt;code&gt;ruby&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Avec ce pipeline, le site est construit à chaque &lt;code&gt;push&lt;/code&gt; sur Gitlab, et la branche &lt;code&gt;master&lt;/code&gt; déployée automatiquement.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Ce nouveau script de déploiement me donne plainement satisfaction, en particulier pour sa simplicité&amp;#160;:
un seul service (Gitlab) gère le code, l&amp;#8217;intégration continue, et le déploiement.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Une alternative aurait pu être d&amp;#8217;utiliser &lt;a href=&quot;https://www.cloudbees.com/products/cloudbees-codeship&quot;&gt;Cloudbess Codeship&lt;/a&gt;.
Mais cette solution aurait nécessité un service supplémentaire.
C&amp;#8217;est la raison pour laquelle je me suis plutôt orienté vers Gitlab, dont j&amp;#8217;apprécie la simplicité et l&amp;#8217;approche &quot;tout en un&quot;.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</description>
        <pubDate>Mon, 11 Mar 2019 00:00:00 +0100</pubDate>
        <link>https://blog.courtine.org/2019/03/11/deploiement-gitlab/</link>
        <guid isPermaLink="true">https://blog.courtine.org/2019/03/11/deploiement-gitlab/</guid>
        
        <category>jekyll</category>
        
        <category>script</category>
        
        
      </item>
    
  </channel>
</rss>
