Skip to content

Lab2 Solution: Inventaire

Créer un groupe ha contenant le premier host

Section titled “Créer un groupe ha contenant le premier host”
vi hosts
[ha]
host161

Créer un groupe web contenant les hosts 2 et 3

Section titled “Créer un groupe web contenant les hosts 2 et 3”
vi hosts
[web]
host162
host163

Créer une variable config pour le host 1 égale à ha.cf

Section titled “Créer une variable config pour le host 1 égale à ha.cf”
vi hosts
host161 config=haproxy.cfg

Créer une variable index pour le groupe web égale à index.html

Section titled “Créer une variable index pour le groupe web égale à index.html”
vi hosts
[web:vars]
index=index.html
vi hosts
[ha]
host161 config=haproxy.cfg
[web]
host162
host163
[web:vars]
index=index.html
vi ~/.ansible.cfg
[defaults]
inventory = /home/sadmin/inventory