Merge "Release notes ha composable"
[apex-tripleo-heat-templates.git] / puppet / services / ceph-mon.yaml
1 heat_template_version: ocata
2
3 description: >
4   Ceph Monitor service.
5
6 parameters:
7   ServiceNetMap:
8     default: {}
9     description: Mapping of service_name -> network name. Typically set
10                  via parameter_defaults in the resource registry.  This
11                  mapping overrides those in ServiceNetMapDefaults.
12     type: json
13   DefaultPasswords:
14     default: {}
15     type: json
16   EndpointMap:
17     default: {}
18     description: Mapping of service endpoint -> protocol. Typically set
19                  via parameter_defaults in the resource registry.
20     type: json
21   CephIPv6:
22     default: False
23     type: boolean
24   CephMonKey:
25     description: The Ceph monitors key. Can be created with ceph-authtool --gen-print-key.
26     type: string
27     hidden: true
28   CinderRbdPoolName:
29     default: volumes
30     type: string
31   ManilaCephFSDataPoolName:
32     default: manila_data
33     type: string
34   ManilaCephFSMetadataPoolName:
35     default: manila_metadata
36     type: string
37   CinderBackupRbdPoolName:
38     default: backups
39     type: string
40   GlanceRbdPoolName:
41     default: images
42     type: string
43   GnocchiRbdPoolName:
44     default: metrics
45     type: string
46   NovaRbdPoolName:
47     default: vms
48     type: string
49   CephPools:
50     description: >
51       It can be used to override settings for one of the predefined pools, or to create
52       additional ones. Example:
53       {
54         "volumes": {
55           "size": 5,
56           "pg_num": 128,
57           "pgp_num": 128
58          }
59       }
60     default: {}
61     type: json
62   MonitoringSubscriptionCephMon:
63     default: 'overcloud-ceph-mon'
64     type: string
65
66 resources:
67   CephBase:
68     type: ./ceph-base.yaml
69     properties:
70       ServiceNetMap: {get_param: ServiceNetMap}
71       DefaultPasswords: {get_param: DefaultPasswords}
72       EndpointMap: {get_param: EndpointMap}
73
74 outputs:
75   role_data:
76     description: Role data for the Ceph Monitor service.
77     value:
78       service_name: ceph_mon
79       monitoring_subscription: {get_param: MonitoringSubscriptionCephMon}
80       config_settings:
81         map_merge:
82           - get_attr: [CephBase, role_data, config_settings]
83           - ceph::profile::params::ms_bind_ipv6: {get_param: CephIPv6}
84             ceph::profile::params::mon_key: {get_param: CephMonKey}
85             ceph::profile::params::osd_pool_default_pg_num: 32
86             ceph::profile::params::osd_pool_default_pgp_num: 32
87             ceph::profile::params::osd_pool_default_size: 3
88             # repeat returns items in a list, so we need to map_merge twice
89             tripleo::profile::base::ceph::mon::ceph_pools:
90               map_merge:
91                 - map_merge:
92                     repeat:
93                       for_each:
94                         <%pool%>:
95                           - {get_param: CinderRbdPoolName}
96                           - {get_param: ManilaCephFSDataPoolName}
97                           - {get_param: ManilaCephFSMetadataPoolName}
98                           - {get_param: CinderBackupRbdPoolName}
99                           - {get_param: NovaRbdPoolName}
100                           - {get_param: GlanceRbdPoolName}
101                           - {get_param: GnocchiRbdPoolName}
102                       template:
103                         <%pool%>:
104                           pg_num: "%{hiera('ceph::profile::params::osd_pool_default_pg_num')}"
105                           pgp_num: "%{hiera('ceph::profile::params::osd_pool_default_pgp_num')}"
106                           size: "%{hiera('ceph::profile::params::osd_pool_default_size')}"
107                 - {get_param: CephPools}
108             tripleo.ceph_mon.firewall_rules:
109               '110 ceph_mon':
110                 dport:
111                   - 6789
112       service_config_settings:
113         get_attr: [CephBase, role_data, service_config_settings]
114       step_config: |
115         include ::tripleo::profile::base::ceph::mon
116       upgrade_batch_tasks:
117         # Note we perform these tasks in list order, but they are all step0 so
118         # we can perform a rolling upgrade of all mon nodes in step0, then a
119         # rolling upgrade of all osd nodes in step1
120         - name: Check status
121           tags: step0,validation
122           shell: ceph health | grep -qv HEALTH_ERR
123         # FIXME(shardy) I suspect we can use heat or ansible facts here instead?
124         - name: Get hostname
125           tags: step0
126           shell: hostname -s
127           register: mon_id
128         - name: Stop Ceph Mon
129           tags: step0
130           service: name=ceph-mon@{{mon_id.stdout}} pattern=ceph-mon state=stopped
131         - name: Update ceph packages
132           tags: step0
133           yum: name=ceph-mon state=latest
134         - name: Start ceph-mon service
135           tags: step0
136           service: name=ceph-mon@{{mon_id.stdout}} state=started
137         - name: ceph osd crush tunables default
138           tags: step0
139           shell: ceph osd crush tunables default