Add inventory file with default groups and group naming conventions

This commit is contained in:
ErdemOzgen 2023-12-18 09:49:09 +03:00
parent c0fe21f4d1
commit 30a65ed7d4
2 changed files with 32 additions and 0 deletions

View File

@ -285,3 +285,32 @@ In this playbook:
The playbook orchestrates the entire workflow across different sets of servers, with each play and its tasks focused on a specific aspect of the overall configuration.
ungrouped:
hosts:
mail.example.com:
webservers:
hosts:
foo.example.com:
bar.example.com:
dbservers:
hosts:
one.example.com:
two.example.com:
three.example.com:
Even if you do not define any groups in your inventory file, Ansible creates two default groups: `all` and `ungrouped`. The `all` group contains every host. The `ungrouped` group contains all hosts that dont have another group aside from `all`. Every host will always belong to at least 2 groups (`all` and `ungrouped` or `all` and some other group). For example, in the basic inventory above, the host `mail.example.com` belongs to the `all` group and the `ungrouped` group; the host `two.example.com` belongs to the `all` group and the `dbservers` group. Though `all` and `ungrouped` are always present, they can be implicit and not appear in group listings like `group_names`.
# How to name groups in ansible
- What - An application, stack or microservice (for example, database servers, web servers, and so on).
- Where - A datacenter or region, to talk to local DNS, storage, and so on (for example, east, west).
- When - The development stage, to avoid testing on production resources (for example, prod, test).
#parentchildansible
https://docs.ansible.com/ansible/latest/inventory_guide/intro_inventory.html#grouping-groups-parent-child-group-relationships

View File

@ -0,0 +1,3 @@
https://code.visualstudio.com/docs/devcontainers/containers
#devcontainers