Merge "puppet: wire in osfamily hieradata support"
[apex-tripleo-heat-templates.git] / puppet / ceph-storage-puppet.yaml
1 heat_template_version: 2014-10-16
2 description: 'Common Ceph Storage Configuration for 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   CephStorageDeployment:
44     type: OS::Heat::StructuredDeployment
45     properties:
46       config: {get_resource: CephStorageConfig}
47       server: {get_resource: CephStorage}
48       input_values:
49         ntp_servers:
50           str_replace:
51             template: '["server"]'
52             params:
53               server: {get_param: NtpServer}
54         enable_package_install: {get_param: EnablePackageInstall}
55   CephStorageConfig:
56     type: OS::Heat::StructuredConfig
57     properties:
58       group: os-apply-config
59       config:
60         hiera:
61           hierarchy:
62             - heat_config_%{::deploy_config_name}
63             - cephstorage
64             - ceph_cluster # provided by CephClusterConfig
65             - ceph
66             - '"%{::osfamily}"'
67             - common
68           datafiles:
69             common:
70               raw_data: {get_file: hieradata/common.yaml}
71             ceph:
72               raw_data: {get_file: hieradata/ceph.yaml}
73             cephstorage:
74               mapped_data:
75                 ntp::servers: {get_input: ntp_servers}
76                 enable_package_install: {get_input: enable_package_install}
77
78 outputs:
79   hosts_entry:
80     value:
81       str_replace:
82         template: "IP HOST HOST.novalocal"
83         params:
84           IP: {get_attr: [CephStorage, networks, ctlplane, 0]}
85           HOST: {get_attr: [CephStorage, name]}
86   nova_server_resource:
87     description: Heat resource handle for the ceph storage server
88     value:
89       {get_resource: CephStorage}