Add role specific information to the service template
[apex-tripleo-heat-templates.git] / puppet / services / ceph-external.yaml
1 heat_template_version: ocata
2
3 description: >
4   Ceph External service.
5
6 parameters:
7   CephClientKey:
8     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.
9     type: string
10     hidden: true
11   CephClientUserName:
12     default: openstack
13     type: string
14   CephClusterFSID:
15     type: string
16     description: The Ceph cluster FSID. Must be a UUID.
17   CephExternalMonHost:
18     default: ''
19     type: string
20     description: List of externally managed Ceph Mon Host IPs. Only used for external Ceph deployments.
21   CinderRbdPoolName:
22     default: volumes
23     type: string
24   CinderBackupRbdPoolName:
25     default: backups
26     type: string
27   GlanceRbdPoolName:
28     default: images
29     type: string
30   GlanceBackend:
31     default: swift
32     description: The short name of the Glance backend to use. Should be one
33       of swift, rbd, or file
34     type: string
35     constraints:
36     - allowed_values: ['swift', 'file', 'rbd']
37   GnocchiRbdPoolName:
38     default: metrics
39     type: string
40   NovaEnableRbdBackend:
41     default: false
42     description: Whether to enable or not the Rbd backend for Nova
43     type: boolean
44   NovaRbdPoolName:
45     default: vms
46     type: string
47   ServiceNetMap:
48     default: {}
49     description: Mapping of service_name -> network name. Typically set
50                  via parameter_defaults in the resource registry.  This
51                  mapping overrides those in ServiceNetMapDefaults.
52     type: json
53   DefaultPasswords:
54     default: {}
55     type: json
56   RoleName:
57     default: ''
58     description: Role name on which the service is applied
59     type: string
60   RoleParameters:
61     default: {}
62     description: Parameters specific to the role
63     type: json
64   EndpointMap:
65     default: {}
66     description: Mapping of service endpoint -> protocol. Typically set
67                  via parameter_defaults in the resource registry.
68     type: json
69   MonitoringSubscriptionCephExternal:
70     default: 'overcloud-ceph-external'
71     type: string
72   RbdDefaultFeatures:
73     default: ''
74     description: The default features enabled when creating a block device
75                  image. Only applies to format 2 images. Set to '1' for Jewel
76                  clients using older Ceph servers.
77     type: string
78
79 conditions:
80   glance_multiple_locations:
81     and:
82     - equals:
83       - get_param: GlanceBackend
84       - rbd
85     - equals:
86       - get_param: NovaEnableRbdBackend
87       - true
88
89 outputs:
90   role_data:
91     description: Role data for the Ceph External service.
92     value:
93       service_name: ceph_external
94       monitoring_subscription: {get_param: MonitoringSubscriptionCephExternal}
95       config_settings:
96         tripleo::profile::base::ceph::ceph_mon_host: {get_param: CephExternalMonHost}
97         ceph::profile::params::fsid: {get_param: CephClusterFSID}
98         ceph::profile::params::rbd_default_features: {get_param: RbdDefaultFeatures}
99         ceph::profile::params::client_keys:
100           map_replace:
101             - CEPH_CLIENT_KEY:
102                 secret: {get_param: CephClientKey}
103                 mode: '0644'
104                 cap_mon: 'allow r'
105                 cap_osd:
106                   str_replace:
107                     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'
108                     params:
109                       NOVA_POOL: {get_param: NovaRbdPoolName}
110                       CINDER_POOL: {get_param: CinderRbdPoolName}
111                       CINDERBACKUP_POOL: {get_param: CinderBackupRbdPoolName}
112                       GLANCE_POOL: {get_param: GlanceRbdPoolName}
113                       GNOCCHI_POOL: {get_param: GnocchiRbdPoolName}
114             - keys:
115                 CEPH_CLIENT_KEY:
116                   list_join: ['.', ['client', {get_param: CephClientUserName}]]
117         ceph::profile::params::manage_repo: false
118         # FIXME(gfidente): we should not have to list the packages explicitly in
119         # the templates, but this should stay until the following is fixed:
120         # https://bugs.launchpad.net/puppet-ceph/+bug/1629933
121         ceph::params::packages:
122           - ceph-base
123           - ceph-mon
124           - ceph-osd
125       service_config_settings:
126         glance_api:
127           glance::api::show_multiple_locations: {if: [glance_multiple_locations, true, false]}
128       step_config: |
129         include ::tripleo::profile::base::ceph::client