modfiied to corner the concerns of Orange labs.
[joid.git] / ci / config_tpl / juju2 / bundle_tpl / ceph.yaml
1 {% if opnfv.storage_dict.ceph is defined %}
2     ceph-mon:
3       charm: "./{{ ubuntu.release }}/ceph-mon"
4       num_units: {{ unit_ceph_qty() }}
5 {% if os.service.bindings %}
6       bindings:
7 {% if opnfv.spaces_dict.public is defined %}
8         public: internal-api
9 {% else %}
10         public: internal-api
11 {% endif %}
12 {% if opnfv.spaces_dict.storage is defined %}
13         cluster: internal-api
14 {% else %}
15         cluster: internal-api
16 {% endif %}
17 {% endif %}
18       options:
19         monitor-count: {{ unit_ceph_qty() }}
20         fsid: ecbb8960-0e21-11e2-b495-83a88f44db01
21         monitor-secret: AQD1P2xQiKglDhAA4NGUF5j38Mhq56qwz+45wg==
22 {% if ubuntu.release == 'trusty' and os.release < 'newton' %}
23         source: "cloud:{{ ubuntu.release }}-updates/{{ os.release }}"
24 {% elif ubuntu.release == 'xenial' and os.release >= 'newton' %}
25         source: "cloud:{{ ubuntu.release }}-updates/{{ os.release }}"
26 {% endif %}
27 {% if os.network.ipv6 %}
28         prefer-ipv6: {{ os.network.ipv6 }}
29 {% endif %}
30       to:
31 {% if os.hyperconverged %}
32 {% for unit_id in to_select(unit_ceph_qty()) %}
33         - "lxd:nodes/{{ unit_id }}"
34 {% endfor %}
35 {% else %}
36 {% if os.ha.mode == 'ha' %}
37 {% for unit_id in range(0, 3) %}
38         - "lxd:nodes/{{ unit_id }}"
39 {% endfor %}
40 {% else %}
41         - "lxd:nodes/0"
42         - "lxd:nodes/0"
43         - "lxd:nodes/0"
44 {% endif %}
45 {% endif %}
46     ceph-osd:
47       charm: "./{{ ubuntu.release }}/ceph-osd"
48 {% if os.hyperconverged %}
49 {% if opnfv.units >= 3 %}
50       num_units: {{ unit_ceph_qty() }}
51 {% else %}
52       num_units: {{ opnfv.units }}
53 {% endif %}
54 {% else %}
55       num_units: 3
56 {% endif %}
57 {% if os.service.bindings %}
58       bindings:
59 {% if opnfv.spaces_dict.public is defined %}
60         public: internal-api
61 {% else %}
62         public: internal-api
63 {% endif %}
64 {% if opnfv.spaces_dict.storage is defined %}
65         cluster: internal-api
66 {% else %}
67         cluster: internal-api
68 {% endif %}
69 {% endif %}
70       options:
71 {% if os.lxd %}
72         osd-devices: /srv/ceph-osd
73 {% else %}
74         osd-devices: {{ opnfv.storage_dict.ceph.disk }}
75 {% endif %}
76         osd-reformat: 'yes'
77 {% if ubuntu.release == 'trusty' and os.release < 'newton' %}
78         source: "cloud:{{ ubuntu.release }}-updates/{{ os.release }}"
79 {% elif ubuntu.release == 'xenial' and os.release >= 'newton' %}
80         source: "cloud:{{ ubuntu.release }}-updates/{{ os.release }}"
81 {% endif %}
82 {% if os.network.ipv6 %}
83         prefer-ipv6: {{ os.network.ipv6 }}
84 {% endif %}
85       to:
86 {% if os.hyperconverged %}
87 {% if opnfv.units >= 3 %}
88 {% for unit_id in range(0, 3) %}
89         - "nodes/{{ unit_id }}"
90 {% endfor %}
91 {% else %}
92  {% for unit_id in range(0, opnfv.units) %}
93          - "nodes/{{ unit_id }}"
94  {% endfor %}
95 {% endif %}
96 {% else %}
97 {% if os.ha.mode == 'ha' %}
98 {% for unit_id in range(0, 3) %}
99         - "nodes/{{ unit_id }}"
100 {% endfor %}
101 {% else %}
102         - "nodes/0"
103         - "nodes-compute/0"
104         - "nodes-compute/1"
105 {% endif %}
106 {% endif %}
107     ceph-radosgw:
108       charm: "./{{ ubuntu.release }}/ceph-radosgw"
109       num_units: {{ unit_qty() if os.beta.hacluster_ceph_radosgw else 1 }}
110 {% if os.service.bindings %}
111       bindings:
112         internal: internal-api
113         admin: internal-api
114 {% if opnfv.spaces_dict.public is defined %}
115         public: public-api
116 {% else %}
117         public: internal-api
118 {% endif %}
119 {% endif %}
120       options:
121         region: {{ os.region }}
122         operator-roles: "Member,admin"
123 {% if ubuntu.release == 'trusty' and os.release < 'newton' %}
124         source: "cloud:{{ ubuntu.release }}-updates/{{ os.release }}"
125 {% elif ubuntu.release == 'xenial' and os.release >= 'newton' %}
126         source: "cloud:{{ ubuntu.release }}-updates/{{ os.release }}"
127 {% endif %}
128 {% if os.network.ipv6 %}
129         prefer-ipv6: {{ os.network.ipv6 }}
130 {% endif %}
131 {% if opnfv.storage_dict.ceph is defined %}
132         ceph-osd-replication-count: {{ unit_ceph_qty() }}
133 {% endif %}
134       to:
135 {% for unit_id in to_select(unit_qty() if os.beta.hacluster_ceph_radosgw else 1) %}
136         - "lxd:nodes/{{ unit_id }}"
137 {% endfor %}
138 {% endif %}