Merge "Don't curl metadata server in userdata example"
[apex-tripleo-heat-templates.git] / docker / services / ceph-ansible / ceph-base.yaml
1 heat_template_version: pike
2
3 description: >
4   Ceph base service. Shared by all Ceph services.
5
6 parameters:
7   ServiceData:
8     default: {}
9     description: Dictionary packing service data
10     type: json
11   ServiceNetMap:
12     default: {}
13     description: Mapping of service_name -> network name. Typically set
14                  via parameter_defaults in the resource registry.  This
15                  mapping overrides those in ServiceNetMapDefaults.
16     type: json
17   DefaultPasswords:
18     default: {}
19     type: json
20   RoleName:
21     default: ''
22     description: Role name on which the service is applied
23     type: string
24   RoleParameters:
25     default: {}
26     description: Parameters specific to the role
27     type: json
28   EndpointMap:
29     default: {}
30     description: Mapping of service endpoint -> protocol. Typically set
31                  via parameter_defaults in the resource registry.
32     type: json
33   CephAnsibleWorkflowName:
34     type: string
35     description: Name of the Mistral workflow to execute
36     default: tripleo.storage.v1.ceph-install
37   CephAnsiblePlaybook:
38     type: string
39     description: Path to the ceph-ansible playbook to execute
40     default: /usr/share/ceph-ansible/site-docker.yml.sample
41   CephAnsibleExtraConfig:
42     type: json
43     description: Extra vars for the ceph-ansible playbook
44     default: {}
45   CephClusterFSID:
46     type: string
47     description: The Ceph cluster FSID. Must be a UUID.
48   CephPoolDefaultPgNum:
49     description: default pg_num to use for the RBD pools
50     type: number
51     default: 32
52   CephPools:
53     description: >
54       It can be used to override settings for one of the predefined pools, or to create
55       additional ones. Example:
56       {
57         "volumes": {
58           "size": 5,
59           "pg_num": 128,
60           "pgp_num": 128
61          }
62       }
63     default: {}
64     type: json
65   CinderRbdPoolName:
66     default: volumes
67     type: string
68   CinderBackupRbdPoolName:
69     default: backups
70     type: string
71   GlanceRbdPoolName:
72     default: images
73     type: string
74   GnocchiRbdPoolName:
75     default: metrics
76     type: string
77   NovaRbdPoolName:
78     default: vms
79     type: string
80   CephClientKey:
81     description: The Ceph client key. Can be created with ceph-authtool --gen-print-key. Currently only used for external Ceph deployments to create the openstack user keyring.
82     type: string
83     hidden: true
84   CephClientUserName:
85     default: openstack
86     type: string
87   CephPoolDefaultSize:
88     description: default minimum replication for RBD copies
89     type: number
90     default: 3
91   CephIPv6:
92     default: False
93     type: boolean
94   DockerCephDaemonImage:
95     description: image
96     type: string
97     default: 'ceph/daemon:tag-build-master-jewel-centos-7'
98
99 conditions:
100   custom_registry_host:
101     yaql:
102       data: {get_param: DockerCephDaemonImage}
103       expression: $.data.split('/')[0].matches('(\.|:)')
104
105 outputs:
106   role_data:
107     description: Role data for the Ceph base service.
108     value:
109       service_name: ceph_base
110       upgrade_tasks: []
111       step_config: ''
112       puppet_config:
113         config_image: ''
114         config_volume: ''
115         step_config: ''
116       docker_config: {}
117       service_workflow_tasks:
118         step2:
119           - name: ceph_base_ansible_workflow
120             workflow: { get_param: CephAnsibleWorkflowName }
121             input:
122               ceph_ansible_extra_vars: {get_param: CephAnsibleExtraConfig}
123               ceph_ansible_playbook: {get_param: CephAnsiblePlaybook}
124       config_settings:
125         ceph_common_ansible_vars:
126           fsid: { get_param: CephClusterFSID }
127           docker: true
128           ceph_docker_registry:
129             if:
130             - custom_registry_host
131             - yaql:
132                 expression: regex('(?:https?://)?(.*)/').split($.data)[1]
133                 data: {str_split: [':', {get_param: DockerCephDaemonImage}, 0]}
134             - docker.io
135           ceph_docker_image:
136             if:
137             - custom_registry_host
138             - yaql:
139                 expression: regex('(?:https?://)?(.*)/').split($.data)[2]
140                 data: {str_split: [':', {get_param: DockerCephDaemonImage}, 0]}
141             - {str_split: [':', {get_param: DockerCephDaemonImage}, 0]}
142           ceph_docker_image_tag: {str_split: [':', {get_param: DockerCephDaemonImage}, 1]}
143           containerized_deployment: true
144           public_network: {get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, CephMonNetwork]}]}
145           cluster_network: {get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, CephClusterNetwork]}]}
146           user_config: true
147           ceph_stable: true
148           ceph_origin: distro
149           openstack_config: true
150           openstack_pools:
151             list_concat:
152               - repeat:
153                   template:
154                     name: <%pool%>
155                     pg_num: {get_param: CephPoolDefaultPgNum}
156                     rule_name: ""
157                   for_each:
158                     <%pool%>:
159                       - {get_param: CinderRbdPoolName}
160                       - {get_param: CinderBackupRbdPoolName}
161                       - {get_param: NovaRbdPoolName}
162                       - {get_param: GlanceRbdPoolName}
163                       - {get_param: GnocchiRbdPoolName}
164               - repeat:
165                   template:
166                     name: <%pool%>
167                     pg_num: {get_param: CephPoolDefaultPgNum}
168                     rule_name: ""
169                   for_each:
170                     <%pool%>: {get_param: CephPools}
171           openstack_keys: &openstack_keys
172           - name:
173               list_join:
174               - '.'
175               - - client
176                 - {get_param: CephClientUserName}
177             key: {get_param: CephClientKey}
178             mon_cap: "allow r"
179             osd_cap:
180               str_replace:
181                template: "allow class-read object_prefix rbd_children, allow rwx pool=CINDER_POOL, allow rwx pool=CINDERBACKUP_POOL, allow rwx pool=NOVA_POOL, allow rwx pool=GLANCE_POOL, allow rwx pool=GNOCCHI_POOL"
182                params:
183                  NOVA_POOL: {get_param: NovaRbdPoolName}
184                  CINDER_POOL: {get_param: CinderRbdPoolName}
185                  CINDERBACKUP_POOL: {get_param: CinderBackupRbdPoolName}
186                  GLANCE_POOL: {get_param: GlanceRbdPoolName}
187                  GNOCCHI_POOL: {get_param: GnocchiRbdPoolName}
188             acls:
189             - "u:glance:r--"
190             - "u:nova:r--"
191             - "u:cinder:r--"
192             - "u:gnocchi:r--"
193           keys: *openstack_keys
194           pools: []
195           ceph_conf_overrides:
196             global:
197               osd_pool_default_size: {get_param: CephPoolDefaultSize}
198               osd_pool_default_pg_num: {get_param: CephPoolDefaultPgNum}
199           ntp_service_enabled: false
200           generate_fsid: false
201           ip_version:
202             if:
203             - {get_param: CephIPv6}
204             - ipv6
205             - ipv4