Add hooks for extra post-deployment config
[apex-tripleo-heat-templates.git] / ceph-storage.yaml
1 heat_template_version: 2014-10-16
2 description: 'Common Ceph Storage Configuration'
3 parameters:
4   Image:
5     type: string
6     default: overcloud-ceph-storage
7   KeyName:
8     default: default
9     description: Name of an existing EC2 KeyPair to enable SSH access to the instances
10     type: string
11   Flavor:
12     default: baremetal
13     description: Flavor for block storage nodes to request when deploying.
14     type: string
15   CephClusterFSID:
16     default: ''
17     type: string
18     description: The Ceph cluster FSID. Must be a UUID.
19   CephMonKey:
20     default: ''
21     description: The Ceph monitors key. Can be created with ceph-authtool --gen-print-key.
22     type: string
23   CephAdminKey:
24     default: ''
25     description: The Ceph admin client key. Can be created with ceph-authtool --gen-print-key.
26     type: string
27   CephMonitors:
28     default: ''
29     description: The list of ip/names to use as Ceph monitors
30     type: json
31 resources:
32   CephStorage:
33     type: OS::Nova::Server
34     properties:
35       image:
36         {get_param: Image}
37       flavor: {get_param: OvercloudCephStorageFlavor}
38       key_name: {get_param: KeyName}
39       networks:
40         - network: ctlplane
41       user_data_format: SOFTWARE_CONFIG
42       user_data: {get_resource: NodeUserData}
43
44   NodeUserData:
45     type: OS::TripleO::NodeUserData
46
47   CephStorageDeployment:
48     type: OS::Heat::StructuredDeployment
49     properties:
50       server: {get_resource: CephStorage}
51       config: {get_resource: CephStorageConfig}
52       signal_transport: NO_SIGNAL
53   CephStorageConfig:
54     type: OS::Heat::StructuredConfig
55     properties:
56       group: os-apply-config
57       config:
58         ceph:
59           fsid: {get_param: CephClusterFSID}
60           keyrings:
61             admin:
62               key: {get_param: CephAdminKey}
63           mon_nodes: {get_param: CephMonitors}
64   ControllerCephDeployment:
65     type: OS::Heat::StructuredDeployment
66     properties:
67       server: {get_resource: Controller}
68       config: {get_resource: ControllerCephConfig}
69       signal_transport: NO_SIGNAL
70   ControllerCephConfig:
71     type: OS::Heat::StructuredConfig
72     properties:
73       group: os-apply-config
74       config:
75         cinder:
76           include_ceph_backend: true
77         ceph:
78           fsid: {get_param: CephClusterFSID}
79           keyrings:
80             mon:
81               key: {get_param: CephMonKey}
82             admin:
83               key: {get_param: CephAdminKey}
84           mon_nodes: {get_param: CephMonitors}
85   NovaComputeCephDeployment:
86     depends_on: [ControllerCephDeployment]
87     type: OS::Heat::StructuredDeployment
88     properties:
89       server: {get_resource: NovaCompute}
90       config: {get_resource: NovaComputeCephConfig}
91       signal_transport: NO_SIGNAL
92   NovaComputeCephConfig:
93     type: OS::Heat::StructuredConfig
94     properties:
95       group: os-apply-config
96       config:
97         ceph:
98           fsid: {get_param: CephClusterFSID}
99           keyrings:
100             admin:
101               key: {get_param: CephAdminKey}
102           mon_nodes: {get_param: CephMonitors}
103 outputs:
104   hosts_entry:
105     value:
106       str_replace:
107         template: "IP HOST HOST.novalocal"
108         params:
109           IP: {get_attr: [CephStorage, networks, ctlplane, 0]}
110           HOST: {get_attr: [CephStorage, name]}