Make puppet-applying *Post resources depend on hieradata
[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   ServiceNetMap:
32     default: {}
33     description: Mapping of service_name -> network name. Typically set
34                  via parameter_defaults in the resource registry.
35     type: json
36   UpdateIdentifier:
37     default: ''
38     type: string
39     description: >
40       Setting to a previously unused value during stack-update will trigger
41       package update on all nodes
42
43 resources:
44   CephStorage:
45     type: OS::Nova::Server
46     properties:
47       image:
48         {get_param: Image}
49       flavor: {get_param: OvercloudCephStorageFlavor}
50       key_name: {get_param: KeyName}
51       networks:
52         - network: ctlplane
53       user_data_format: SOFTWARE_CONFIG
54       user_data: {get_resource: NodeUserData}
55
56   NodeUserData:
57     type: OS::TripleO::NodeUserData
58
59   StoragePort:
60     type: OS::TripleO::CephStorage::Ports::StoragePort
61     properties:
62       ControlPlaneIP: {get_attr: [CephStorage, networks, ctlplane, 0]}
63
64   StorageMgmtPort:
65     type: OS::TripleO::CephStorage::Ports::StorageMgmtPort
66     properties:
67       ControlPlaneIP: {get_attr: [CephStorage, networks, ctlplane, 0]}
68
69   NetworkConfig:
70     type: OS::TripleO::CephStorage::Net::SoftwareConfig
71     properties:
72       StorageIpSubnet: {get_attr: [StoragePort, ip_subnet]}
73       StorageMgmtIpSubnet: {get_attr: [StorageMgmtPort, ip_subnet]}
74
75   NetworkDeployment:
76     type: OS::TripleO::SoftwareDeployment
77     properties:
78       config: {get_resource: NetworkConfig}
79       server: {get_resource: CephStorage}
80
81   CephStorageDeployment:
82     type: OS::Heat::StructuredDeployment
83     properties:
84       server: {get_resource: CephStorage}
85       config: {get_resource: CephStorageConfig}
86       signal_transport: NO_SIGNAL
87   CephStorageConfig:
88     type: OS::Heat::StructuredConfig
89     properties:
90       group: os-apply-config
91       config:
92         ceph:
93           fsid: {get_param: CephClusterFSID}
94           keyrings:
95             admin:
96               key: {get_param: CephAdminKey}
97           mon_nodes: {get_param: CephMonitors}
98   ControllerCephDeployment:
99     type: OS::Heat::StructuredDeployment
100     properties:
101       server: {get_resource: Controller}
102       config: {get_resource: ControllerCephConfig}
103       signal_transport: NO_SIGNAL
104   ControllerCephConfig:
105     type: OS::Heat::StructuredConfig
106     properties:
107       group: os-apply-config
108       config:
109         cinder:
110           include_ceph_backend: true
111         ceph:
112           fsid: {get_param: CephClusterFSID}
113           keyrings:
114             mon:
115               key: {get_param: CephMonKey}
116             admin:
117               key: {get_param: CephAdminKey}
118           mon_nodes: {get_param: CephMonitors}
119   NovaComputeCephDeployment:
120     depends_on: [ControllerCephDeployment]
121     type: OS::Heat::StructuredDeployment
122     properties:
123       server: {get_resource: NovaCompute}
124       config: {get_resource: NovaComputeCephConfig}
125       signal_transport: NO_SIGNAL
126   NovaComputeCephConfig:
127     type: OS::Heat::StructuredConfig
128     properties:
129       group: os-apply-config
130       config:
131         ceph:
132           fsid: {get_param: CephClusterFSID}
133           keyrings:
134             admin:
135               key: {get_param: CephAdminKey}
136           mon_nodes: {get_param: CephMonitors}
137 outputs:
138   hosts_entry:
139     value:
140       str_replace:
141         template: "IP HOST"
142         params:
143           IP: {get_attr: [CephStorage, networks, ctlplane, 0]}
144           HOST: {get_attr: [CephStorage, name]}
145   storage_ip_address:
146     description: IP address of the server in the storage network
147     value: {get_attr: [StoragePort, ip_address]}
148   storage_mgmt_ip_address:
149     description: IP address of the server in the storage_mgmt network
150     value: {get_attr: [StorageMgmtPort, ip_address]}
151   config_identifier:
152     description: identifier which changes if the node configuration may need re-applying
153     value: "None - NO_SIGNAL"