<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Archives des Ansible - CoffeeBreak Info</title>
	<atom:link href="https://coffeebreak.en-images.info/tag/ansible/feed/" rel="self" type="application/rss+xml" />
	<link>https://coffeebreak.en-images.info/tag/ansible/</link>
	<description>Une petite pause :)</description>
	<lastBuildDate>Fri, 04 Jun 2021 20:45:42 +0000</lastBuildDate>
	<language>fr-FR</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>

<image>
	<url>https://coffeebreak.en-images.info/wp-content/uploads/2021/07/cropped-Tasse_Cafe-scaled-1-32x32.jpg</url>
	<title>Archives des Ansible - CoffeeBreak Info</title>
	<link>https://coffeebreak.en-images.info/tag/ansible/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>MODOP &#8211; Déploiement automatisé sur Cluster PROXMOX</title>
		<link>https://coffeebreak.en-images.info/modop-deploiement-automatiser-sur-proxmox/</link>
					<comments>https://coffeebreak.en-images.info/modop-deploiement-automatiser-sur-proxmox/#respond</comments>
		
		<dc:creator><![CDATA[chris]]></dc:creator>
		<pubDate>Fri, 04 Jun 2021 19:12:20 +0000</pubDate>
				<category><![CDATA[PROXMOX]]></category>
		<category><![CDATA[Ansible]]></category>
		<category><![CDATA[Cluster]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Proxmox]]></category>
		<guid isPermaLink="false">https://coffeebreak.en-images.info/?p=537</guid>

					<description><![CDATA[<p>Le but est de lancer des mises à jours automatisées sur l’ensemble des serveurs en utilisant une machine master via Ansible.<br />
Cela va permettre des mises à jours , Installation , paramétrage sur l'ensemble d'un cluster machine via une seul commande lancée.</p>
<p>L’article <a href="https://coffeebreak.en-images.info/modop-deploiement-automatiser-sur-proxmox/">MODOP &#8211; Déploiement automatisé sur Cluster PROXMOX</a> est apparu en premier sur <a href="https://coffeebreak.en-images.info">CoffeeBreak Info</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><strong>4 Serveurs PROXMOX</strong></p>
<ul>
<li>192.168.1.50 tex01</li>
<li>192.168.1.51 tex02</li>
<li>192.168.1.52 tex03</li>
<li>192.168.1.53 tex04</li>
</ul>
<p><img fetchpriority="high" decoding="async" width="1577" height="412" class="wp-image-538" src="https://coffeebreak.en-images.info/wp-content/uploads/2021/06/word-image-98.png" srcset="https://coffeebreak.en-images.info/wp-content/uploads/2021/06/word-image-98.png 1577w, https://coffeebreak.en-images.info/wp-content/uploads/2021/06/word-image-98-300x78.png 300w, https://coffeebreak.en-images.info/wp-content/uploads/2021/06/word-image-98-1024x268.png 1024w, https://coffeebreak.en-images.info/wp-content/uploads/2021/06/word-image-98-768x201.png 768w, https://coffeebreak.en-images.info/wp-content/uploads/2021/06/word-image-98-1536x401.png 1536w, https://coffeebreak.en-images.info/wp-content/uploads/2021/06/word-image-98-1x1.png 1w" sizes="(max-width: 1577px) 100vw, 1577px" /></p>
<p>Le but est de lancer des mises à jours automatisées sur l’ensemble des serveurs en utilisant une machine master qui va&nbsp; lancer pour chacune des machines les commandes souhaitées.</p>
<p><strong>Aout des machines du CLuster Proxmox dans /etc/hosts.</strong><br />
<span style="text-decoration: underline;">Exemple&nbsp;sur tex01</span><br />
root@tex01:~# <span style="color: #ff0000;"><strong>cat /etc/hosts</strong></span><br />
<span style="color: #ff0000;"><em>127.0.0.1 localhost.localdomain localhost</em></span><br />
<span style="color: #ff0000;"><em>192.168.1.50 tex01.home tex01</em></span><br />
<span style="color: #ff0000;"><em>192.168.1.51 tex02.home tex02</em></span><br />
<span style="color: #ff0000;"><em>192.168.1.52 tex03.home tex03</em></span><br />
<span style="color: #ff0000;"><em>192.168.1.53 tex04.home tex04</em></span></p>
<p><strong>Ajout d’une clef SSH et cela pour chaque serveur</strong><br />
<span style="text-decoration: underline;">Exemple sur tex01</span></p>
<p><strong>Générer la Clef Public et Privé</strong><br />
root@tex01:~#<strong><span style="color: #ff0000;"> ssh-keygen -b 2048</span></strong></p>
<p><strong>Copier la Clef Pubic sur les machine tex02,tex3 et tex04</strong><br />
root@tex01:~# <strong><span style="color: #ff0000;">ssh-copy-id -i .ssh/id_rsa.pub root@tex02</span></strong><br />
root@tex01:~# <strong><span style="color: #ff0000;">ssh-copy-id -i .ssh/id_rsa.pub root@tex03</span></strong><br />
root@tex01:~#<strong><span style="color: #ff0000;"> ssh-copy-id -i .ssh/id_rsa.pub root@tex04</span></strong></p>
<p>Faire cela pour les serveurs tex02,tex03 et tex04.</p>
<p><strong>Vérifier que SSH autorise les connexions root</strong><br />
Editer le fichier /etc/ssh/sshd_config pour autoriser les connexions root ssh.</p>
<p>Décommenter les lignes suivantes:<br />
<span style="color: #ff0000;"><em>PermitRootLogin yes</em></span><br />
<span style="color: #ff0000;"><em>PubkeyAuthentication yes</em></span></p>
<p><strong>Installer et configure ansible sur une machine Master (tex01)</strong><br />
root@tex01:~# <strong><span style="color: #ff0000;">apt update &amp;&amp; apt upgrade</span></strong><br />
root@tex01:~# <span style="color: #ff0000;"><strong>apt-get install ansible</strong></span><br />
root@tex01:/# <span style="color: #ff0000;"><strong>cd /etc/ansible/</strong></span></p>
<p><strong>Editer le fichier /etc/ansible/hosts et ajouter le cluster proxmox</strong><br />
<em><span style="color: #ff0000;">[proxmox-cluster]</span></em><br />
<em><span style="color: #ff0000;">tex01</span></em><br />
<em><span style="color: #ff0000;">tex02</span></em><br />
<em><span style="color: #ff0000;">tex03</span></em><br />
<em><span style="color: #ff0000;">tex04</span></em></p>
<p><strong>Test à présent communication ansible sur le cluster</strong><br />
root@tex01:/etc/ansible# <strong><span style="color: #ff0000;">ansible -m ping all</span></strong></p>
<p><img decoding="async" width="744" height="299" class="wp-image-539" src="https://coffeebreak.en-images.info/wp-content/uploads/2021/06/word-image-99.png" srcset="https://coffeebreak.en-images.info/wp-content/uploads/2021/06/word-image-99.png 744w, https://coffeebreak.en-images.info/wp-content/uploads/2021/06/word-image-99-300x121.png 300w, https://coffeebreak.en-images.info/wp-content/uploads/2021/06/word-image-99-1x1.png 1w" sizes="(max-width: 744px) 100vw, 744px" /></p>
<p><strong>Pour récupérer des informations</strong><br />
root@tex01:/etc/ansible# <strong><span style="color: #ff0000;">ansible proxmox-cluster -m setup &#8211;tree /tmp/facts_servers/</span></strong></p>
<p><strong>Exemple pour récupérer les IP du Cluster</strong><br />
root@tex01:/etc/ansible# <span style="color: #ff0000;"><strong>ansible proxmox-cluster -m setup &#8211;tree /tmp/facts_servers/ |grep &lsquo; »address »:&rsquo; |sort |uniq</strong></span></p>
<p><img decoding="async" width="1465" height="521" class="wp-image-541" src="https://coffeebreak.en-images.info/wp-content/uploads/2021/06/word-image-100.png" srcset="https://coffeebreak.en-images.info/wp-content/uploads/2021/06/word-image-100.png 1465w, https://coffeebreak.en-images.info/wp-content/uploads/2021/06/word-image-100-300x107.png 300w, https://coffeebreak.en-images.info/wp-content/uploads/2021/06/word-image-100-1024x364.png 1024w, https://coffeebreak.en-images.info/wp-content/uploads/2021/06/word-image-100-768x273.png 768w, https://coffeebreak.en-images.info/wp-content/uploads/2021/06/word-image-100-1x1.png 1w" sizes="(max-width: 1465px) 100vw, 1465px" /></p>
<p><strong>Connaitre le «&nbsp;uptime&nbsp;» sur le cluster</strong><br />
root@tex01:/etc/ansible# <strong><span style="color: #ff0000;">ansible all -m command -u root &#8211;args « uptime » &#8211;one-line</span></strong></p>
<p><img loading="lazy" decoding="async" width="1045" height="94" class="wp-image-544" src="https://coffeebreak.en-images.info/wp-content/uploads/2021/06/word-image-101.png" srcset="https://coffeebreak.en-images.info/wp-content/uploads/2021/06/word-image-101.png 1045w, https://coffeebreak.en-images.info/wp-content/uploads/2021/06/word-image-101-300x27.png 300w, https://coffeebreak.en-images.info/wp-content/uploads/2021/06/word-image-101-1024x92.png 1024w, https://coffeebreak.en-images.info/wp-content/uploads/2021/06/word-image-101-768x69.png 768w, https://coffeebreak.en-images.info/wp-content/uploads/2021/06/word-image-101-1x1.png 1w" sizes="auto, (max-width: 1045px) 100vw, 1045px" /></p>
<p><strong>Déployer sur tous le cluster des packages que l’on souhaite avoir via un playbook.</strong><br />
root@tex01:/etc/ansible# <strong><span style="color: #ff0000;">vi necessary.xml</span></strong><br />
<span style="color: #ff0000;"><em>&#8212;</em></span><br />
<span style="color: #ff0000;"><em>&#8211; hosts: proxmox-cluster</em></span><br />
<span style="color: #ff0000;"><em>remote_user: root</em></span><br />
<span style="color: #ff0000;"><em>tasks:</em></span><br />
<span style="color: #ff0000;"><em>&#8211; name: install common packages for all servers</em></span><br />
<span style="color: #ff0000;"><em>apt:</em></span><br />
<span style="color: #ff0000;"><em>update_cache=yes</em></span><br />
<span style="color: #ff0000;"><em>state=latest</em></span><br />
<span style="color: #ff0000;"><em>name={{item}}</em></span><br />
<span style="color: #ff0000;"><em>with_items:</em></span><br />
<span style="color: #ff0000;"><em>&#8211; curl</em></span><br />
<span style="color: #ff0000;"><em>&#8211; htop</em></span><br />
<span style="color: #ff0000;"><em>&#8211; ncdu</em></span><br />
<span style="color: #ff0000;"><em>&#8211; pwgen</em></span><br />
<span style="color: #ff0000;"><em>&#8211; strace</em></span><br />
<span style="color: #ff0000;"><em>&#8211; sudo</em></span><br />
<span style="color: #ff0000;"><em>&#8211; tar</em></span><br />
<span style="color: #ff0000;"><em>&#8211; unzip</em></span><br />
<span style="color: #ff0000;"><em>&#8211; vim</em></span><br />
<span style="color: #ff0000;"><em>&#8211; wget</em></span><br />
<span style="color: #ff0000;"><em>&#8211; whois</em></span></p>
<p><strong>Test de la syntaxe ansible.</strong><br />
root@tex01:/etc/ansible# <strong><span style="color: #ff0000;">ansible-playbook &#8211;syntax-check necessary.xml</span></strong></p>
<p><strong>Lancement du playbook pour deployer à tous les hosts les packages</strong><br />
root@tex01:/etc/ansible# <strong><span style="color: #ff0000;">ansible-playbook -i hosts necessary.xml</span></strong></p>
<p><img loading="lazy" decoding="async" width="1618" height="529" class="wp-image-546" src="https://coffeebreak.en-images.info/wp-content/uploads/2021/06/word-image-102.png" srcset="https://coffeebreak.en-images.info/wp-content/uploads/2021/06/word-image-102.png 1618w, https://coffeebreak.en-images.info/wp-content/uploads/2021/06/word-image-102-300x98.png 300w, https://coffeebreak.en-images.info/wp-content/uploads/2021/06/word-image-102-1024x335.png 1024w, https://coffeebreak.en-images.info/wp-content/uploads/2021/06/word-image-102-768x251.png 768w, https://coffeebreak.en-images.info/wp-content/uploads/2021/06/word-image-102-1536x502.png 1536w, https://coffeebreak.en-images.info/wp-content/uploads/2021/06/word-image-102-1x1.png 1w" sizes="auto, (max-width: 1618px) 100vw, 1618px" /></p>
<p>Avec une seule commande, on a installé 11 paquets sur les 4 hosts du cluster proxmox-cluster.</p>
<p>Views: 23</p><p>L’article <a href="https://coffeebreak.en-images.info/modop-deploiement-automatiser-sur-proxmox/">MODOP &#8211; Déploiement automatisé sur Cluster PROXMOX</a> est apparu en premier sur <a href="https://coffeebreak.en-images.info">CoffeeBreak Info</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://coffeebreak.en-images.info/modop-deploiement-automatiser-sur-proxmox/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
