modified to made an option to support spaces as per JUJU 2.0
[joid.git] / ci / config_tpl / juju2 / bundle_tpl / ceph.yaml
1 {% if opnfv.storage_dict.ceph is defined %}
2     ceph:
3       charm: "./{{ ubuntu.release }}/ceph"
4       num_units: {{ unit_ceph_qty() }}
5       options:
6         monitor-count: {{ unit_ceph_qty() }}
7         fsid: 5a791d94-980b-11e4-b6f6-3c970e8b1cf7
8         monitor-secret: AQAi5a9UeJXUExAA+By9u+GPhl8/XiUQ4nwI3A==
9 {% if ubuntu.release == 'trusty' and os.release < 'newton' %}
10         source: "cloud:{{ ubuntu.release }}-updates/{{ os.release }}"
11 {% elif ubuntu.release == 'xenial' and os.release >= 'newton' %}
12         source: "cloud:{{ ubuntu.release }}-updates/{{ os.release }}"
13 {% endif %}
14 {% if os.network.ipv6 %}
15         prefer-ipv6: {{ os.network.ipv6 }}
16 {% endif %}
17 {% if opnfv.spaces_dict.storage is defined %}
18         #ceph-cluster-network: {{ opnfv.spaces_dict.storage.cidr }}
19 {% endif %}
20       to:
21 {% if os.hyperconverged %}
22 {% for unit_id in to_select(unit_ceph_qty()) %}
23         - "lxd:nodes/{{ unit_id }}"
24 {% endfor %}
25 {% else %}
26 {% if os.ha.mode == 'ha' %}
27 {% for unit_id in range(0, 3) %}
28         - "lxd:nodes/{{ unit_id }}"
29 {% endfor %}
30 {% else %}
31         - "lxd:nodes/0"
32         - "lxd:nodes/0"
33         - "lxd:nodes/0"
34 {% endif %}
35 {% endif %}
36     ceph-osd:
37       charm: "./{{ ubuntu.release }}/ceph-osd"
38 {% if os.hyperconverged %}
39 {% if opnfv.units >= 3 %}
40       num_units: {{ unit_ceph_qty() }}
41 {% else %}
42       num_units: {{ opnfv.units }}
43 {% endif %}
44 {% else %}
45       num_units: 3
46 {% endif %}
47       options:
48         osd-devices: {{ opnfv.storage_dict.ceph.disk }}
49         osd-reformat: 'yes'
50 {% if ubuntu.release == 'trusty' and os.release < 'newton' %}
51         source: "cloud:{{ ubuntu.release }}-updates/{{ os.release }}"
52 {% elif ubuntu.release == 'xenial' and os.release >= 'newton' %}
53         source: "cloud:{{ ubuntu.release }}-updates/{{ os.release }}"
54 {% endif %}
55 {% if os.network.ipv6 %}
56         prefer-ipv6: {{ os.network.ipv6 }}
57 {% endif %}
58       to:
59 {% if os.hyperconverged %}
60 {% if opnfv.units >= 3 %}
61 {% for unit_id in range(0, 3) %}
62         - "nodes/{{ unit_id }}"
63 {% endfor %}
64 {% else %}
65  {% for unit_id in range(0, opnfv.units) %}
66          - "nodes/{{ unit_id }}"
67  {% endfor %}
68 {% endif %}
69 {% else %}
70 {% if os.ha.mode == 'ha' %}
71 {% for unit_id in range(0, 3) %}
72         - "nodes/{{ unit_id }}"
73 {% endfor %}
74 {% else %}
75         - "nodes/0"
76         - "nodes-compute/0"
77         - "nodes-compute/1"
78 {% endif %}
79 {% endif %}
80     ceph-radosgw:
81       charm: "./{{ ubuntu.release }}/ceph-radosgw"
82       num_units: {{ unit_qty() if os.beta.hacluster_ceph_radosgw else 1 }}
83 {% if os.service.bindings %}
84       bindings:
85         internal: internal
86 {% if opnfv.spaces_dict.data is defined %}
87         admin: admin
88 {% else %}
89         admin: internal
90 {% endif %}
91 {% if opnfv.spaces_dict.public is defined %}
92         public: public
93 {% else %}
94         public: internal
95 {% endif %}
96 {% endif %}
97       options:
98         region: {{ os.region }}
99         use-embedded-webserver: true
100         operator-roles: "Member,admin"
101 {% if ubuntu.release == 'trusty' and os.release < 'newton' %}
102         source: "cloud:{{ ubuntu.release }}-updates/{{ os.release }}"
103 {% elif ubuntu.release == 'xenial' and os.release >= 'newton' %}
104         source: "cloud:{{ ubuntu.release }}-updates/{{ os.release }}"
105 {% endif %}
106 {% if os.network.ipv6 %}
107         prefer-ipv6: {{ os.network.ipv6 }}
108 {% endif %}
109 {% if opnfv.storage_dict.ceph is defined %}
110         ceph-osd-replication-count: {{ unit_ceph_qty() }}
111 {% endif %}
112       to:
113 {% for unit_id in to_select(unit_qty() if os.beta.hacluster_ceph_radosgw else 1) %}
114         - "lxd:nodes/{{ unit_id }}"
115 {% endfor %}
116 {% endif %}