[dev]
fitness.dev
[nginx]
fitness.dev
fitness.staging
www1.fitness.tld
www2.fitness.tld
[webserver]
nginx
例如剧本中某些步骤的结果。
tasks:
- name: Print out the group_names
debug: msg="{{ hostvars.group_names[] }}"
我只关注主机广告资源文件中的group_names。
喜欢:
hostvars.groups_names[0] is dev
hostvars.groups_names[1] is nginx
hostvars.groups_names[2] is webservers