I'm trying to use a yaml file as inventory file which looks like below:
- prod:
webserver:
hosts:
example1.com
db_servers:
hosts:
example2.com
example3.com
- stag:
webserver:
hosts:
example3.com
It doesn't seem to work, and I couldn't find much info on ansible docs arounf yaml inventory file. Is the above supported?
相关问题
- Access ansible.cfg variable in task
- Unable to get “exclude” option working with unarch
- Ansible: find file and loop over paths
- Generating tuples variables in ansible templates
- Ansible: setting user on dynamic ec2
相关文章
- Ansible create postgresql user with access to all
- Difference between shell and command in ansible
- How to make Ansible run one certain task only on o
- clone a specific branch from git through ansible p
- Check if a list contains an item in Ansible
- Defining host as variable in Ansible hosts file
- ansible/jinja2 get unique subelements
- Custom credentials in Ansible Tower with Custom Py
No, this is not supported. You are supposed to have different inventories for production/testing.
You can only define single dependency tree like this:
In this case group
test
is a parent ofwebserver
anddb_servers
.