2012-04-14 15:45:24 +02:00
|
|
|
---
|
|
|
|
|
2012-07-12 07:29:51 +02:00
|
|
|
# Below is the original way of defining hosts and groups.
|
|
|
|
|
2012-04-14 15:45:24 +02:00
|
|
|
- jupiter
|
|
|
|
- host: saturn
|
|
|
|
vars:
|
2012-04-19 08:26:54 +02:00
|
|
|
moon: titan
|
|
|
|
moon2: enceladus
|
2012-04-14 15:45:24 +02:00
|
|
|
|
2012-06-26 11:38:10 +02:00
|
|
|
- host: mars
|
|
|
|
|
2012-05-08 09:19:55 +02:00
|
|
|
- host: zeus
|
|
|
|
vars:
|
|
|
|
- ansible_ssh_port: 3001
|
2012-04-16 10:55:08 +02:00
|
|
|
|
2012-04-14 15:45:24 +02:00
|
|
|
- group: greek
|
|
|
|
hosts:
|
|
|
|
- zeus
|
|
|
|
- hera
|
|
|
|
- poseidon
|
|
|
|
vars:
|
|
|
|
- ansible_ssh_port: 3000
|
2012-04-19 08:26:54 +02:00
|
|
|
- ntp_server: olympus.example.com
|
2012-04-14 15:45:24 +02:00
|
|
|
|
|
|
|
- group: norse
|
|
|
|
hosts:
|
|
|
|
- host: thor
|
|
|
|
vars:
|
|
|
|
- hammer: True
|
|
|
|
- odin
|
|
|
|
- loki
|
|
|
|
|
2012-04-28 18:23:44 +02:00
|
|
|
- group: ruler
|
|
|
|
hosts:
|
|
|
|
- zeus
|
|
|
|
- odin
|
|
|
|
|
2012-04-14 15:45:24 +02:00
|
|
|
- group: multiple
|
|
|
|
hosts:
|
|
|
|
- saturn
|
2012-07-12 07:29:51 +02:00
|
|
|
|
|
|
|
# Here we demonstrate that groups can be defined on a per-host basis.
|
|
|
|
# When managing a large set of systems this format makes it easier to
|
|
|
|
# ensure each of the systems is defined in a set of groups, compared
|
|
|
|
# to the standard group definitions, where a host may need to be added
|
|
|
|
# to multiple disconnected groups.
|
|
|
|
|
|
|
|
- host: garfield
|
|
|
|
groups: [ comic, cat, orange ]
|
|
|
|
vars:
|
|
|
|
- nose: pink
|
|
|
|
|
|
|
|
- host: odie
|
|
|
|
groups: [ comic, dog, yellow ]
|
|
|
|
|
|
|
|
- host: mickey
|
|
|
|
groups: [ cartoon, mouse, red ]
|
|
|
|
|
|
|
|
- host: goofy
|
|
|
|
groups: [ cartoon, dog, orange ]
|
|
|
|
|
|
|
|
- host: tom
|
|
|
|
groups: [ cartoon, cat, gray ]
|
|
|
|
|
|
|
|
- host: jerry
|
|
|
|
groups: [ cartoon, mouse, brown ]
|
|
|
|
|
|
|
|
- group: cat
|
|
|
|
vars:
|
|
|
|
- ears: pointy
|
|
|
|
- nose: black
|
|
|
|
|
|
|
|
- group: dog
|
|
|
|
vars:
|
|
|
|
- ears: flappy
|
|
|
|
- nose: black
|
|
|
|
|
|
|
|
- group: mouse
|
|
|
|
vars:
|
|
|
|
- ears: round
|
|
|
|
- nose: black
|