-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathhost_groups.yml
More file actions
81 lines (77 loc) · 2.91 KB
/
host_groups.yml
File metadata and controls
81 lines (77 loc) · 2.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
---
# populate groups that are needed for roles but not in inventory
# node and zone
- name: node group default
add_host:
groups: node
hostname: "{{ item }}"
inventory_dir: "{{ hostvars[item].inventory_dir }}"
when: "'node' not in groups"
with_items: "{{ groups.cloud }}"
- name: zone group default
add_host:
groups: zone
hostname: "{{ item }}"
inventory_dir: "{{ hostvars[item].inventory_dir }}"
when: "'zone' not in groups"
with_items: "{{ groups.cloud }}"
- name: zone assignments default
set_fact: "host_zone_key={{ item.0 + 1 }}"
when: "'host_zone_key' not in hostvars[inventory_hostname] and inventory_hostname == item.1"
with_indexed_items: "{{ groups.zone|sort }}"
- name: node zone assignments default
set_fact: "host_zone_key={{ (item.0 % (groups.zone|length)) + 1 }}"
when: "'host_zone_key' not in hostvars[inventory_hostname] and inventory_hostname == item.1"
with_indexed_items: "{{ groups.node|sort }}"
# console
- name: console group default
add_host:
groups: console
hostname: "{{ item }}"
inventory_dir: "{{ hostvars[item].inventory_dir }}"
when: "'console' not in groups and not eucalyptus_console_cloud_deploy|default(False)"
with_items: "{{ groups.cloud }}"
# ceph
- name: node to ceph group for converged deployments
add_host:
groups: ceph
hostname: "{{ item }}"
inventory_dir: "{{ hostvars[item].inventory_dir }}"
when: ceph_converged|default(False)
with_items: "{{ groups.node }}"
- name: cloud to ceph_object_gateway group for converged deployments
add_host:
groups: ceph_object_gateway
hostname: "{{ item }}"
inventory_dir: "{{ hostvars[item].inventory_dir }}"
when: "ceph_converged|default(False) and ('ceph_object_gateway' not in groups)"
with_items: "{{ groups.cloud }}"
- name: ceph_deploy group default
add_host:
groups: ceph_deploy
hostname: "{{ item }}"
inventory_dir: "{{ hostvars[item].inventory_dir }}"
when: "'ceph' in groups and groups.ceph and 'ceph_deploy' not in groups"
with_items: "{{ groups.ceph[0] }}"
- name: ceph_object_gateway group default
add_host:
groups: ceph_object_gateway
hostname: "{{ item }}"
inventory_dir: "{{ hostvars[item].inventory_dir }}"
when: "'ceph' in groups and groups.ceph and 'ceph_object_gateway' not in groups"
with_items: "{{ groups.ceph[0] }}"
# midonet
- name: node to midonet_nsdb group for converged vpcmido deployments
add_host:
groups: midonet_nsdb
hostname: "{{ item }}"
inventory_dir: "{{ hostvars[item].inventory_dir }}"
when: ceph_converged|default(False) and net_mode|default('EDGE') == 'VPCMIDO'
with_items: "{{ groups.node }}"
- name: cloud to midonet_nsdb group for default vpcmido deployments
add_host:
groups: midonet_nsdb
hostname: "{{ item }}"
inventory_dir: "{{ hostvars[item].inventory_dir }}"
when: "'midonet_nsdb' not in groups and net_mode|default('EDGE') == 'VPCMIDO'"
with_items: "{{ groups.cloud }}"