기본
/etc/ansible/hosts 파일로 호스트들을 관리할 수는 있지만 호스트 많아지면 덜직관적이라서 힘들다그래서 트리구조 가지는 yaml 활용한 ansible inventory가 있는데
Using Variables - Ansible Documentation
While automation exists to make it easier to make things repeatable, all systems are not exactly alike; some may require configuration that is slightly different from others. In some instances, the observed behavior or state of one system might influence how you configure other systems. For example, you might need to find out the IP address of a system and use it as a configuration value on another system.
https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html

How to build your inventory - Ansible Documentation
Ansible works against multiple managed nodes or "hosts" in your infrastructure at the same time, using a list or group of lists know as inventory. Once your inventory is defined, you use to select the hosts or groups you want Ansible to run against. The default location for inventory is a file called /etc/ansible/hosts .
https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html

위 공식문서를 보고 참고해서 ansible-inventory 에 정리했다
그러면 아래같이 트리구조로 inventory 정리가능
children, vars, hosts, all 같은 예약어만 몇개 알아두면 되는 문법 자체는 어렵지 않다

사실 35줄을 43줄로 늘였긴 했지만 가독성이 yaml 이 좋으니 뭐 흠흠

Seonglae Cho