d8d4f0af2306265ce9d1501d3f47520e64309d89
[apex-tripleo-heat-templates.git] / puppet / ceph-cluster-config.yaml
1 heat_template_version: 2015-04-30
2 description: 'Ceph Cluster config data for Puppet'
3
4 parameters:
5   ceph_storage_count:
6     default: 0
7     type: number
8     description: Number of Ceph storage nodes. Used to enable/disable managed Ceph installation.
9   ceph_external_mon_ips:
10     default: ''
11     type: string
12     description: List of external Ceph Mon host IPs.
13   ceph_client_key:
14     default: ''
15     type: string
16     description: Ceph key used to create the client user keyring.
17   ceph_fsid:
18     default: ''
19     type: string
20   ceph_admin_key:
21     default: ''
22     type: string
23   ceph_mon_key:
24     default: ''
25     type: string
26   ceph_mon_names:
27     type: comma_delimited_list
28   ceph_mon_ips:
29     type: comma_delimited_list
30   NovaRbdPoolName:
31     default: vms
32     type: string
33   CinderRbdPoolName:
34     default: volumes
35     type: string
36   GlanceRbdPoolName:
37     default: images
38     type: string
39   CephClientUserName:
40     default: openstack
41     type: string
42   CephIPv6:
43     default: False
44     type: boolean
45
46 resources:
47   CephClusterConfigImpl:
48     type: OS::Heat::StructuredConfig
49     properties:
50       group: os-apply-config
51       config:
52         hiera:
53           datafiles:
54             ceph_cluster:
55               mapped_data:
56                 ceph_ipv6: {get_param: CephIPv6}
57                 ceph_storage_count: {get_param: ceph_storage_count}
58                 ceph_mon_initial_members:
59                   list_join:
60                   - ','
61                   - {get_param: ceph_mon_names}
62                 ceph_mon_host:
63                   list_join:
64                   - ','
65                   - {get_param: ceph_mon_ips}
66                 ceph_mon_host_v6:
67                   str_replace:
68                     template: "'[IPS_LIST]'"
69                     params:
70                       IPS_LIST:
71                         list_join:
72                         - '],['
73                         - {get_param: ceph_mon_ips}
74                 ceph::profile::params::ms_bind_ipv6: {get_param: CephIPv6}
75                 ceph::profile::params::fsid: {get_param: ceph_fsid}
76                 ceph::profile::params::mon_key: {get_param: ceph_mon_key}
77                 # We should use a separated key for the non-admin clients
78                 ceph::profile::params::client_keys:
79                   str_replace:
80                     template: "{
81                       client.admin: {
82                         secret: 'ADMIN_KEY',
83                         mode: '0600',
84                         cap_mon: 'allow *',
85                         cap_osd: 'allow *',
86                         cap_mds: 'allow *'
87                       },
88                       client.bootstrap-osd: {
89                         secret: 'ADMIN_KEY',
90                         keyring_path: '/var/lib/ceph/bootstrap-osd/ceph.keyring',
91                         cap_mon: 'allow profile bootstrap-osd'
92                       },
93                       client.CLIENT_USER: {
94                         secret: 'CLIENT_KEY',
95                         mode: '0644',
96                         cap_mon: 'allow r',
97                         cap_osd: 'allow class-read object_prefix rbd_children, allow rwx pool=CINDER_POOL, allow rwx pool=NOVA_POOL, allow rwx pool=GLANCE_POOL'
98                       }
99                     }"
100                     params:
101                       CLIENT_USER: {get_param: CephClientUserName}
102                       CLIENT_KEY: {get_param: ceph_client_key}
103                       ADMIN_KEY: {get_param: ceph_admin_key}
104                       NOVA_POOL: {get_param: NovaRbdPoolName}
105                       CINDER_POOL: {get_param: CinderRbdPoolName}
106                       GLANCE_POOL: {get_param: GlanceRbdPoolName}
107                 nova::compute::rbd::libvirt_images_rbd_pool: {get_param: NovaRbdPoolName}
108                 cinder_rbd_pool_name: {get_param: CinderRbdPoolName}
109                 glance::backend::rbd::rbd_store_pool: {get_param: GlanceRbdPoolName}
110                 nova::compute::rbd::libvirt_rbd_user: {get_param: CephClientUserName}
111                 glance::backend::rbd::rbd_store_user: {get_param: CephClientUserName}
112                 nova::compute::rbd::rbd_keyring:
113                   list_join:
114                   - '.'
115                   - - 'client'
116                     - {get_param: CephClientUserName}
117                 ceph_client_user_name: {get_param: CephClientUserName}
118                 ceph_pools:
119                   - {get_param: CinderRbdPoolName}
120                   - {get_param: NovaRbdPoolName}
121                   - {get_param: GlanceRbdPoolName}
122
123 outputs:
124   config_id:
125     description: The ID of the CephClusterConfigImpl resource.
126     value:
127       {get_resource: CephClusterConfigImpl}