Merge "Inject TLS certificate and keys for the Overcloud"
[apex-tripleo-heat-templates.git] / os-apply-config / 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     hidden: true
24   CephAdminKey:
25     default: ''
26     description: The Ceph admin client key. Can be created with ceph-authtool --gen-print-key.
27     type: string
28     hidden: true
29   CephMonitors:
30     default: ''
31     description: The list of ip/names to use as Ceph monitors
32     type: json
33   ServiceNetMap:
34     default: {}
35     description: Mapping of service_name -> network name. Typically set
36                  via parameter_defaults in the resource registry.
37     type: json
38   UpdateIdentifier:
39     default: ''
40     type: string
41     description: >
42       Setting to a previously unused value during stack-update will trigger
43       package update on all nodes
44   Hostname:
45     type: string
46     default: '' # Defaults to Heat created hostname
47   ExtraConfig:
48     default: {}
49     description: |
50       Additional configuration to inject into the cluster. Note
51       that CephStorageExtraConfig takes precedence over ExtraConfig.
52     type: json
53   CephStorageExtraConfig:
54     default: {}
55     description: |
56       Role specific additional configuration to inject into the cluster.
57     type: json
58
59
60 resources:
61   CephStorage:
62     type: OS::Nova::Server
63     properties:
64       image:
65         {get_param: Image}
66       flavor: {get_param: OvercloudCephStorageFlavor}
67       key_name: {get_param: KeyName}
68       networks:
69         - network: ctlplane
70       user_data_format: SOFTWARE_CONFIG
71       user_data: {get_resource: NodeUserData}
72       name: {get_param: Hostname}
73
74   NodeUserData:
75     type: OS::TripleO::NodeUserData
76
77   StoragePort:
78     type: OS::TripleO::CephStorage::Ports::StoragePort
79     properties:
80       ControlPlaneIP: {get_attr: [CephStorage, networks, ctlplane, 0]}
81
82   StorageMgmtPort:
83     type: OS::TripleO::CephStorage::Ports::StorageMgmtPort
84     properties:
85       ControlPlaneIP: {get_attr: [CephStorage, networks, ctlplane, 0]}
86
87   NetworkConfig:
88     type: OS::TripleO::CephStorage::Net::SoftwareConfig
89     properties:
90       ControlPlaneIp: {get_attr: [CephStorage, networks, ctlplane, 0]}
91       StorageIpSubnet: {get_attr: [StoragePort, ip_subnet]}
92       StorageMgmtIpSubnet: {get_attr: [StorageMgmtPort, ip_subnet]}
93
94   NetworkDeployment:
95     type: OS::TripleO::SoftwareDeployment
96     properties:
97       config: {get_resource: NetworkConfig}
98       server: {get_resource: CephStorage}
99
100   CephStorageDeployment:
101     type: OS::Heat::StructuredDeployment
102     properties:
103       server: {get_resource: CephStorage}
104       config: {get_resource: CephStorageConfig}
105       signal_transport: NO_SIGNAL
106   CephStorageConfig:
107     type: OS::Heat::StructuredConfig
108     properties:
109       group: os-apply-config
110       config:
111         ceph:
112           fsid: {get_param: CephClusterFSID}
113           keyrings:
114             admin:
115               key: {get_param: CephAdminKey}
116           mon_nodes: {get_param: CephMonitors}
117   ControllerCephDeployment:
118     type: OS::Heat::StructuredDeployment
119     properties:
120       server: {get_resource: Controller}
121       config: {get_resource: ControllerCephConfig}
122       signal_transport: NO_SIGNAL
123   ControllerCephConfig:
124     type: OS::Heat::StructuredConfig
125     properties:
126       group: os-apply-config
127       config:
128         cinder:
129           include_ceph_backend: true
130         ceph:
131           fsid: {get_param: CephClusterFSID}
132           keyrings:
133             mon:
134               key: {get_param: CephMonKey}
135             admin:
136               key: {get_param: CephAdminKey}
137           mon_nodes: {get_param: CephMonitors}
138   NovaComputeCephDeployment:
139     depends_on: [ControllerCephDeployment]
140     type: OS::Heat::StructuredDeployment
141     properties:
142       server: {get_resource: NovaCompute}
143       config: {get_resource: NovaComputeCephConfig}
144       signal_transport: NO_SIGNAL
145   NovaComputeCephConfig:
146     type: OS::Heat::StructuredConfig
147     properties:
148       group: os-apply-config
149       config:
150         ceph:
151           fsid: {get_param: CephClusterFSID}
152           keyrings:
153             admin:
154               key: {get_param: CephAdminKey}
155           mon_nodes: {get_param: CephMonitors}
156 outputs:
157   hosts_entry:
158     value:
159       str_replace:
160         template: "IP HOST"
161         params:
162           IP: {get_attr: [CephStorage, networks, ctlplane, 0]}
163           HOST: {get_attr: [CephStorage, name]}
164   storage_ip_address:
165     description: IP address of the server in the storage network
166     value: {get_attr: [StoragePort, ip_address]}
167   storage_mgmt_ip_address:
168     description: IP address of the server in the storage_mgmt network
169     value: {get_attr: [StorageMgmtPort, ip_address]}
170   config_identifier:
171     description: identifier which changes if the node configuration may need re-applying
172     value: "None - NO_SIGNAL"