Le 13/12/11 08:05, Michael DeHaan claviotta :
> Before we dive into a technical solution let me understand your use case
> and what you are modelling a bit better.
>
> So groups['ceph-ODSs'] would be all machines in the ceph-ODSs group.
That's right.
>
> I'd probably just define a variable like "disks" on the group, but I'm
> unclear why that wouldn't work in your case.
>
> I could probably understand more if I could see how "disks" differs between
> hosts.
It's simple, my Ceph OSD (storage nodes) are all différents. Some
contains 2 hard drives (sdb, sdc), some contains 10 (sdb, sdc, sdd…).
"disks" is a list of hard drives, which is different from one host to
another. ex:
inventory
osd0
osd1
[ceph-OSDs]
osd0
osd1
host_vars/osd0
disks:
- sdb
host_vars/osd1
disks:
- sdb
- sdc
In my nested loop, I need to loop over the Ceph Storage nodes and
their hard drive. The hard drive list is an host variable (accessible
by hostvars[osd0]['disks'], for instance).
With the example above, I want my playbook to do :
ceph_deploy osd prepare osd0:sda
ceph_deploy osd prepare osd1:sda
ceph_deploy osd prepare osd1:sdb