feat: aggiunti file alla sezione 2_inventory

This commit is contained in:
Alessandro Rabiti 2024-07-08 10:57:03 +02:00
parent 46cc807ad7
commit 975b71cf8e
6 changed files with 73 additions and 1 deletions

View file

@ -0,0 +1,4 @@
---
all:
hosts:
host1test.mydomain.xyz:

View file

@ -0,0 +1,5 @@
---
gruppo_test:
hosts:
host1test.mydomain.xyz:
host2test.mydomain.xyz:

View file

@ -0,0 +1,7 @@
---
gruppo_test:
hosts:
host1test.mydomain.xyz:
ansible_host: 127.0.0.2
host2test.mydomain.xyz:
ansible_host: 127.0.0.3

View file

@ -0,0 +1,9 @@
---
gruppo_test:
hosts:
host1test.mydomain.xyz:
ansible_host: 127.0.0.2
host2test.mydomain.xyz:
ansible_host: 127.0.0.3
vars:
ansible_user: nobody

View file

@ -0,0 +1,23 @@
---
gruppo_test:
hosts:
host1test.mydomain.xyz:
ansible_host: 127.0.0.2
host2test.mydomain.xyz:
ansible_host: 127.0.0.3
vars:
ansible_user: nobody
gruppo_prod:
hosts:
host1prod.mydomain.xyz:
ansible_host: 127.0.0.4
host2prod.mydomain.xyz:
ansible_host: 127.0.0.5
vars:
ansible_user: root
gruppo_all:
children:
gruppo_test:
gruppo_prod:

View file

@ -34,5 +34,29 @@ cat 14_inventory-test
2.0) Esempio file di inventory in formato yaml: 2.0) Esempio file di inventory in formato yaml:
- Nell'inventory è presente il solo host host1test.mydomain.xyz - Nell'inventory è presente il solo host host1test.mydomain.xyz
``` ```
cat 20_inventory-test cat 20_inventory-test.yaml
```
2.1) Esempio file di inventory in formato yaml con gruppo:
- Nell'inventory è presente il gruppo gruppo_test composto da due hosts
```
cat 21_inventory-test.yaml
```
2.2) Esempio file di inventory in formato yaml con gruppo e variabili dei singoli hosts:
- Nell'inventory è presente il gruppo gruppo_test composto da due hosts con la variabile che definisce gli IP
```
cat 22_inventory-test.yaml
```
2.3) Esempio file di inventory in formato yaml con gruppo e variabili per il gruppo:
- Nell'inventory è presente il gruppo gruppo_test composto da due hosts con la variabile che definisce gli IP e la variabile ansible_user valida per l'intero gruppo
```
cat 23_inventory-test.yaml
```
2.4) Esempio file di inventory in formato yaml con gruppi, sottogruppi e variabili:
- Nell'inventory sono presenti due gruppi, gruppo_test e gruppo_prod. Inoltre è presente il gruppo gruppo_all che comprende i due sottogruppi gruppo_test e gruppo_prod
```
cat 24_inventory-test.yaml
``` ```