os-net-config templates to configure vlans on bond
[apex-tripleo-heat-templates.git] / puppet / ceph-storage-puppet.yaml
1 heat_template_version: 2015-04-30
2 description: 'OpenStack ceph storage node configured by Puppet'
3 parameters:
4   Flavor:
5     description: Flavor for the Ceph Storage node.
6     type: string
7     constraints:
8       - custom_constraint: nova.flavor
9   Image:
10     type: string
11     default: overcloud-ceph-storage
12     constraints:
13       - custom_constraint: glance.image
14   ImageUpdatePolicy:
15     default: 'REBUILD_PRESERVE_EPHEMERAL'
16     description: What policy to use when reconstructing instances. REBUILD for rebuilds, REBUILD_PRESERVE_EPHEMERAL to preserve /mnt.
17     type: string
18   KeyName:
19     description: Name of an existing EC2 KeyPair to enable SSH access to the instances
20     type: string
21     default: default
22     constraints:
23       - custom_constraint: nova.keypair
24   NtpServer:
25     type: string
26     default: ''
27   EnablePackageInstall:
28     default: 'false'
29     description: Set to true to enable package installation via Puppet
30     type: boolean
31
32 resources:
33   CephStorage:
34     type: OS::Nova::Server
35     properties:
36       image: {get_param: Image}
37       image_update_policy: {get_param: ImageUpdatePolicy}
38       flavor: {get_param: Flavor}
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       config: {get_resource: CephStorageConfig}
74       server: {get_resource: CephStorage}
75       input_values:
76         ntp_servers:
77           str_replace:
78             template: '["server"]'
79             params:
80               server: {get_param: NtpServer}
81         enable_package_install: {get_param: EnablePackageInstall}
82
83   CephStorageConfig:
84     type: OS::Heat::StructuredConfig
85     properties:
86       group: os-apply-config
87       config:
88         hiera:
89           hierarchy:
90             - heat_config_%{::deploy_config_name}
91             - cephstorage
92             - ceph_cluster # provided by CephClusterConfig
93             - ceph
94             - '"%{::osfamily}"'
95             - common
96           datafiles:
97             common:
98               raw_data: {get_file: hieradata/common.yaml}
99             ceph:
100               raw_data: {get_file: hieradata/ceph.yaml}
101             cephstorage:
102               mapped_data:
103                 ntp::servers: {get_input: ntp_servers}
104                 enable_package_install: {get_input: enable_package_install}
105
106 outputs:
107   hosts_entry:
108     value:
109       str_replace:
110         template: "IP HOST"
111         params:
112           IP: {get_attr: [CephStorage, networks, ctlplane, 0]}
113           HOST: {get_attr: [CephStorage, name]}
114   nova_server_resource:
115     description: Heat resource handle for the ceph storage server
116     value:
117       {get_resource: CephStorage}
118   storage_ip_address:
119     description: IP address of the server in the storage network
120     value: {get_attr: [StoragePort, ip_address]}
121   storage_mgmt_ip_address:
122     description: IP address of the server in the storage_mgmt network
123     value: {get_attr: [StorageMgmtPort, ip_address]}