问题原文
原帖链接 · blue_meme · CC BY-SA 4.0
We have Apache setup chrooted, so we can multiple apache on single directory for multiple httpd instance. I have added all the different groups with the instance name in inventory but their hosts are same.
While I am running tasks on one httpd instance, it takes groups vars of different group even though the hosts are same in all groups.
社区高分解答
原帖链接 · TheDESTROS · CC BY-SA 4.0
This answer can help: Ansible same host on different groups with group_vars
Try overriding host variables each time it is required with "vars_files":
hosts: {{ group_name }}
vars_files:
- group_vars/{{ group_name }}.yml
tasks:
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
