Ansible with “Alternative Directory Layout” and using vaults

别说谁变了你拦得住时间么 提交于 2019-12-02 03:03:45

You define variable app_user in a file called var.yml stored in group_vars folder.

In your execution line you point to the inventories/inv/hosts as your inventory directory.

It doesn't matter what strings you used in this path -- from Ansible's point of view it sees only:

hosts
group_vars
├── var.yml
└── vault.yml

It will read var.yml for a host group called var and vault.yml for a host group called vault.

In your case -- never.


You likely wanted to organise your files this way:

inventories
└── production
    ├── group_vars
    │   └── inv
    │       ├── var.yml
    │       └── vault.yml
    └── hosts

This way, files in group_vars/inv will be read for hosts in group inv.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!