Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen Revision Vorhergehende Überarbeitung | |||
| centos:ansible:hosts [19.06.2020 20:15. ] – django | centos:ansible:hosts [20.09.2022 10:16. ] (aktuell) – gelöscht django | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | ==== / | ||
| - | In der Konfigurationsdatei **''/ | ||
| - | |||
| - | In dieser Konfigurationsdatei gelten folgende Rahmenparameter: | ||
| - | * Kommentare beginnen mit dem Zeichen '#' | ||
| - | * Leere Zeilen werden ignoriert | ||
| - | * Gruppen von Hosts werden durch [header]-Elemente abgegrenzt | ||
| - | * Es können Hostnamen oder IP-Adressen verwendet werden | ||
| - | * Ein Hostname/ | ||
| - | |||
| - | # vim / | ||
| - | <file bash / | ||
| - | # It should live in / | ||
| - | # | ||
| - | # - Comments begin with the '#' | ||
| - | # - Blank lines are ignored | ||
| - | # - Groups of hosts are delimited by [header] elements | ||
| - | # - You can enter hostnames or ip addresses | ||
| - | # - A hostname/ip can be a member of multiple groups | ||
| - | |||
| - | # Ex 1: Ungrouped hosts, specify before any group headers. | ||
| - | |||
| - | ## green.example.com | ||
| - | ## blue.example.com | ||
| - | ## 192.168.100.1 | ||
| - | ## 192.168.100.10 | ||
| - | |||
| - | # Ex 2: A collection of hosts belonging to the ' | ||
| - | |||
| - | ## [webservers] | ||
| - | ## alpha.example.org | ||
| - | ## beta.example.org | ||
| - | ## 192.168.1.100 | ||
| - | ## 192.168.1.110 | ||
| - | |||
| - | # If you have multiple hosts following a pattern you can specify | ||
| - | # them like this: | ||
| - | |||
| - | ## www[001: | ||
| - | |||
| - | # Ex 3: A collection of database servers in the ' | ||
| - | |||
| - | ## [dbservers] | ||
| - | ## | ||
| - | ## db01.intranet.mydomain.net | ||
| - | ## db02.intranet.mydomain.net | ||
| - | ## 10.25.1.56 | ||
| - | ## 10.25.1.57 | ||
| - | |||
| - | # Here's another example of host ranges, this time there are no | ||
| - | # leading 0s: | ||
| - | |||
| - | ## db-[99: | ||
| - | |||
| - | </ | ||
| - | |||
| - | Für unsere nachfolgenden ersten Test ergänzen wir die Konfigurationsdatei um folgende Zeilen. | ||
| - | <code bash># Django : 2019-12-30 | ||
| - | # alle CentOS 7 Hosts | ||
| - | [centos_7] | ||
| - | bh7.dmz.nausch.org | ||
| - | |||
| - | # alle CentOS 8 Hosts | ||
| - | [centos_8] | ||
| - | 10.0.0.190 | ||
| - | |||
| - | # alle CentOS-Hosts unabhängig von der Releaseversion | ||
| - | [centos_all] | ||
| - | 10.0.0.190 | ||
| - | bh7.dmz.nausch.org</ | ||
| - | |||
| - | Wir definieren damit folgende Hostgruppen: | ||
| - | * **'' | ||
| - | * **'' | ||
| - | * **'' | ||
| - | |||
| - | Mit dem Befehl **'' | ||
| - | # ansible --list-hosts centos_7 | ||
| - | < | ||
| - | bh7.dmz.nausch.org</ | ||
| - | # ansible --list-hosts centos_8 | ||
| - | < | ||
| - | 10.0.0.190</ | ||
| - | # ansible --list-hosts centos_all | ||
| - | < | ||
| - | 10.0.0.190 | ||
| - | bh7.dmz.nausch.org</ | ||