I need to change some files in YAML format from one "big" yml to several smaller files. Unfortunately, I do not know which part belongs where. For example, I have the following .yml:
all:
hosts:
station01:
dns_name: localhost
ansible_host: localhost
work01:
dns_name: X.X.X.X
ansible_host: Y.Y.Y.Y
vars:
yum_proxy: false
zabbix_proxy_ip: A.A.A.A
yum_proxy_ip:
dns_servers:
- B.B.B.B
- C.C.C.C
timezone: XXX
ntp_servers:
- D.D.D.D
disable_firewall_tasks: true
children:
deploy:
hosts:
station01:
linux:
hosts:
work01:
work_users:
hosts:
work01:
vars:
users:
- john: user
- mike: user
I believe that hosts file should looke like this:
all:
hosts:
station01
work01
children:
deploy:
hosts:
station01:
linux:
hosts:
work01:
work_users:
hosts:
work01:
The group_vars "all.yml" looks like this, I guess:
---
all:
yum_proxy: false
zabbix_proxy_ip: A.A.A.A
yum_proxy_ip:
dns_servers:
- B.B.B.B
- C.C.C.C
timezone: XXX
ntp_servers:
- D.D.D.D
disable_firewall_tasks: true
And this is where the problem begins. I do not know where to put the "users:". Should it be in host_vars "work01.yml" assigned to one host, like this:
---
work01:
dns_name: X.X.X.X
ansible_host: Y.Y.Y.Y
users:
- john: user
- mike: user
Or should it be contained in the group_vars file named "work_users.yml"?
---
users:
- john: user
- mike: user
What the files host_vars and group_vars should look like? Any kind of help would be appreciated.