Merge "Store role_data in an OS::Heat::Value resource"
[apex-tripleo-heat-templates.git] / puppet / services / ceph-base.yaml
1 heat_template_version: pike
2
3 description: >
4   Ceph base service. Shared by all Ceph services.
5
6 parameters:
7   # NOTE(gfidente): needs a default to cope with external Ceph deployments were we don't pass (and need) an Admin key
8   CephAdminKey:
9     default: ''
10     description: The Ceph admin client key. Can be created with ceph-authtool --gen-print-key.
11     type: string
12     hidden: true
13   CephClientKey:
14     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.
15     type: string
16     hidden: true
17   CephClientUserName:
18     default: openstack
19     type: string
20   CephClusterFSID:
21     type: string
22     description: The Ceph cluster FSID. Must be a UUID.
23   CinderRbdPoolName:
24     default: volumes
25     type: string
26   CinderBackupRbdPoolName:
27     default: backups
28     type: string
29   GlanceRbdPoolName:
30     default: images
31     type: string
32   GlanceBackend:
33     default: swift
34     description: The short name of the Glance backend to use. Should be one
35       of swift, rbd, or file
36     type: string
37     constraints:
38     - allowed_values: ['swift', 'file', 'rbd']
39   GnocchiRbdPoolName:
40     default: metrics
41     type: string
42   NovaEnableRbdBackend:
43     default: false
44     description: Whether to enable or not the Rbd backend for Nova
45     type: boolean
46   NovaRbdPoolName:
47     default: vms
48     type: string
49   ServiceNetMap:
50     default: {}
51     description: Mapping of service_name -> network name. Typically set
52                  via parameter_defaults in the resource registry.  This
53                  mapping overrides those in ServiceNetMapDefaults.
54     type: json
55   DefaultPasswords:
56     default: {}
57     type: json
58   RoleName:
59     default: ''
60     description: Role name on which the service is applied
61     type: string
62   RoleParameters:
63     default: {}
64     description: Parameters specific to the role
65     type: json
66   EndpointMap:
67     default: {}
68     description: Mapping of service endpoint -> protocol. Typically set
69                  via parameter_defaults in the resource registry.
70     type: json
71   # DEPRECATED options for compatibility with overcloud.yaml
72   # This should be removed and manipulation of the ControllerServices list
73   # used instead, but we need client support for that first
74   ControllerEnableCephStorage:
75     default: false
76     description: Whether to deploy Ceph Storage (OSD) on the Controller
77     type: boolean
78
79 parameter_groups:
80 - label: deprecated
81   description: Do not use deprecated params, they will be removed.
82   parameters:
83   - ControllerEnableCephStorage
84
85 conditions:
86   glance_multiple_locations:
87     and:
88     - equals:
89       - get_param: GlanceBackend
90       - rbd
91     - equals:
92       - get_param: NovaEnableRbdBackend
93       - true
94
95 outputs:
96   role_data:
97     description: Role data for the Ceph base service.
98     value:
99       service_name: ceph_base
100       config_settings:
101         tripleo::profile::base::ceph::enable_ceph_storage: {get_param: ControllerEnableCephStorage}
102         ceph::profile::params::osds: {/srv/data: {}}
103         ceph::profile::params::manage_repo: false
104         ceph::profile::params::authentication_type: cephx
105         ceph::profile::params::fsid: {get_param: CephClusterFSID}
106         # FIXME(gfidente): we should not have to list the packages explicitly in the templates,
107         # but this has to stay until https://bugs.launchpad.net/puppet-ceph/+bug/1629933 is fixed
108         ceph::params::packages:
109           - ceph-base
110           - ceph-mon
111           - ceph-osd
112         # NOTE: bind IP is found in Heat replacing the network name with the local node IP
113         # for the given network; replacement examples (eg. for internal_api):
114         # internal_api -> IP
115         # internal_api_uri -> [IP]
116         # internal_api_subnet - > IP/CIDR
117         ceph::profile::params::cluster_network:
118           str_replace:
119             template: "NETWORK_subnet"
120             params:
121               NETWORK: {get_param: [ServiceNetMap, CephClusterNetwork]}
122         ceph::profile::params::public_network:
123           str_replace:
124             template: "NETWORK_subnet"
125             params:
126               NETWORK: {get_param: [ServiceNetMap, CephMonNetwork]}
127         ceph::profile::params::public_addr: {get_param: [ServiceNetMap, CephMonNetwork]}
128         ceph::profile::params::client_keys:
129           map_replace:
130             - client.admin:
131                 secret: {get_param: CephAdminKey}
132                 mode: '0600'
133                 cap_mon: 'allow *'
134                 cap_osd: 'allow *'
135                 cap_mds: 'allow *'
136               client.bootstrap-osd:
137                 secret: {get_param: CephAdminKey}
138                 keyring_path: '/var/lib/ceph/bootstrap-osd/ceph.keyring'
139                 cap_mon: 'allow profile bootstrap-osd'
140               CEPH_CLIENT_KEY:
141                 secret: {get_param: CephClientKey}
142                 mode: '0644'
143                 cap_mon: 'allow r'
144                 cap_osd:
145                   str_replace:
146                     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'
147                     params:
148                       NOVA_POOL: {get_param: NovaRbdPoolName}
149                       CINDER_POOL: {get_param: CinderRbdPoolName}
150                       CINDERBACKUP_POOL: {get_param: CinderBackupRbdPoolName}
151                       GLANCE_POOL: {get_param: GlanceRbdPoolName}
152                       GNOCCHI_POOL: {get_param: GnocchiRbdPoolName}
153             - keys:
154                 CEPH_CLIENT_KEY:
155                   list_join: ['.', ['client', {get_param: CephClientUserName}]]
156       service_config_settings:
157         glance_api:
158           glance::api::show_multiple_locations: {if: [glance_multiple_locations, true, false]}