Merge "Reuse the various service passwords as db passwords."
[apex-tripleo-heat-templates.git] / ceph-storage.yaml
1 heat_template_version: 2015-04-30
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
32 resources:
33   CephStorage:
34     type: OS::Nova::Server
35     properties:
36       image:
37         {get_param: Image}
38       flavor: {get_param: OvercloudCephStorageFlavor}
39       key_name: {get_param: KeyName}
40       networks:
41         - network: ctlplane
42       user_data_format: SOFTWARE_CONFIG
43       user_data: {get_resource: NodeUserData}
44
45   NodeUserData:
46     type: OS::TripleO::NodeUserData
47
48   StoragePort:
49     type: OS::TripleO::CephStorage::Ports::StoragePort
50     properties:
51       ControlPlaneIP: {get_attr: [CephStorage, networks, ctlplane, 0]}
52
53   StorageMgmtPort:
54     type: OS::TripleO::CephStorage::Ports::StorageMgmtPort
55     properties:
56       ControlPlaneIP: {get_attr: [CephStorage, networks, ctlplane, 0]}
57
58   NetworkConfig:
59     type: OS::TripleO::CephStorage::Net::SoftwareConfig
60     properties:
61       StorageIpSubnet: {get_attr: [StoragePort, ip_subnet]}
62       StorageMgmtIpSubnet: {get_attr: [StorageMgmtPort, ip_subnet]}
63
64   NetworkDeployment:
65     type: OS::TripleO::SoftwareDeployment
66     properties:
67       config: {get_resource: NetworkConfig}
68       server: {get_resource: CephStorage}
69
70   CephStorageDeployment:
71     type: OS::Heat::StructuredDeployment
72     properties:
73       server: {get_resource: CephStorage}
74       config: {get_resource: CephStorageConfig}
75       signal_transport: NO_SIGNAL
76   CephStorageConfig:
77     type: OS::Heat::StructuredConfig
78     properties:
79       group: os-apply-config
80       config:
81         ceph:
82           fsid: {get_param: CephClusterFSID}
83           keyrings:
84             admin:
85               key: {get_param: CephAdminKey}
86           mon_nodes: {get_param: CephMonitors}
87   ControllerCephDeployment:
88     type: OS::Heat::StructuredDeployment
89     properties:
90       server: {get_resource: Controller}
91       config: {get_resource: ControllerCephConfig}
92       signal_transport: NO_SIGNAL
93   ControllerCephConfig:
94     type: OS::Heat::StructuredConfig
95     properties:
96       group: os-apply-config
97       config:
98         cinder:
99           include_ceph_backend: true
100         ceph:
101           fsid: {get_param: CephClusterFSID}
102           keyrings:
103             mon:
104               key: {get_param: CephMonKey}
105             admin:
106               key: {get_param: CephAdminKey}
107           mon_nodes: {get_param: CephMonitors}
108   NovaComputeCephDeployment:
109     depends_on: [ControllerCephDeployment]
110     type: OS::Heat::StructuredDeployment
111     properties:
112       server: {get_resource: NovaCompute}
113       config: {get_resource: NovaComputeCephConfig}
114       signal_transport: NO_SIGNAL
115   NovaComputeCephConfig:
116     type: OS::Heat::StructuredConfig
117     properties:
118       group: os-apply-config
119       config:
120         ceph:
121           fsid: {get_param: CephClusterFSID}
122           keyrings:
123             admin:
124               key: {get_param: CephAdminKey}
125           mon_nodes: {get_param: CephMonitors}
126 outputs:
127   hosts_entry:
128     value:
129       str_replace:
130         template: "IP HOST"
131         params:
132           IP: {get_attr: [CephStorage, networks, ctlplane, 0]}
133           HOST: {get_attr: [CephStorage, name]}
134   storage_ip_address:
135     description: IP address of the server in the storage network
136     value: {get_attr: [StoragePort, ip_address]}
137   storage_mgmt_ip_address:
138     description: IP address of the server in the storage_mgmt network
139     value: {get_attr: [StorageMgmtPort, ip_address]}