Puppet: Configure neutron_api_class on controller
[apex-tripleo-heat-templates.git] / puppet / cinder-storage-puppet.yaml
1 heat_template_version: 2014-10-16
2 description: 'Block Storage Configuration w/ Puppet'
3 parameters:
4   Image:
5     default: overcloud-cinder-volume
6     type: string
7   CinderISCSIHelper:
8     default: tgtadm
9     description: The iSCSI helper to use with cinder.
10     type: string
11   CinderLVMLoopDeviceSize:
12     default: 5000
13     description: The size of the loopback file used by the cinder LVM driver.
14     type: number
15   VirtualIP:
16     default: ''
17     type: string
18   ExtraConfig:
19     default: {}
20     description: |
21       Additional configuration to inject into the cluster. The JSON should have
22       the following structure:
23         {"FILEKEY":
24           {"config":
25             [{"section": "SECTIONNAME",
26               "values":
27                 [{"option": "OPTIONNAME",
28                   "value": "VALUENAME"
29                  }
30                 ]
31              }
32             ]
33           }
34         }
35       For instance:
36         {"nova":
37           {"config":
38             [{"section": "default",
39               "values":
40                 [{"option": "force_config_drive",
41                   "value": "always"
42                  }
43                 ]
44              },
45              {"section": "cells",
46               "values":
47                 [{"option": "driver",
48                   "value": "nova.cells.rpc_driver.CellsRPCDriver"
49                  }
50                 ]
51              }
52             ]
53           }
54         }
55     type: json
56   Flavor:
57     description: Flavor for block storage nodes to request when deploying.
58     type: string
59     constraints:
60       - custom_constraint: nova.flavor
61   GlancePort:
62     default: "9292"
63     description: Glance port.
64     type: string
65   KeyName:
66     default: default
67     description: Name of an existing EC2 KeyPair to enable SSH access to the instances
68     type: string
69   RabbitPassword:
70     default: ''
71     type: string
72   RabbitUserName:
73     default: ''
74     type: string
75   SnmpdReadonlyUserName:
76     default: ro_snmp_user
77     description: The user name for SNMPd with readonly rights running on all Overcloud nodes
78     type: string
79   SnmpdReadonlyUserPassword:
80     default: unset
81     description: The user password for SNMPd with readonly rights running on all Overcloud nodes
82     type: string
83     hidden: true
84   NtpServer:
85     type: string
86     default: ''
87   EnablePackageInstall:
88     default: 'false'
89     description: Set to true to enable package installation via Puppet
90     type: boolean
91
92 resources:
93   BlockStorage:
94     type: OS::Nova::Server
95     properties:
96       image:
97         {get_param: Image}
98       flavor: {get_param: Flavor}
99       key_name: {get_param: KeyName}
100       user_data_format: SOFTWARE_CONFIG
101       networks:
102         - network: ctlplane
103
104   BlockStorageDeployment:
105     type: OS::Heat::StructuredDeployment
106     properties:
107       server: {get_resource: BlockStorage}
108       config: {get_resource: BlockStorageConfig}
109       input_values:
110         cinder_dsn: {list_join: ['', ['mysql://cinder:unset@', {get_param: VirtualIP} , '/cinder']]}
111         snmpd_readonly_user_name: {get_param: SnmpdReadonlyUserName}
112         snmpd_readonly_user_password: {get_param: SnmpdReadonlyUserPassword}
113         cinder_lvm_loop_device_size:
114           str_replace:
115             template: sizeM
116             params:
117               size: {get_param: CinderLVMLoopDeviceSize}
118         cinder_iscsi_helper: {get_param: CinderISCSIHelper}
119         rabbit_hosts:
120           str_replace:
121             template: '["host"]'
122             params:
123               host: {get_param: VirtualIP}
124         rabbit_username: {get_param: RabbitUserName}
125         rabbit_password: {get_param: RabbitPassword}
126         ntp_servers:
127           str_replace:
128             template: '["server"]'
129             params:
130               server: {get_param: NtpServer}
131         enable_package_install: {get_param: EnablePackageInstall}
132       signal_transport: NO_SIGNAL
133
134   # Map heat metadata into hiera datafiles
135   BlockStorageConfig:
136     type: OS::Heat::StructuredConfig
137     properties:
138       group: os-apply-config
139       config:
140         hiera:
141           hierarchy:
142             - heat_config_%{::deploy_config_name}
143             - volume
144             - common
145           datafiles:
146             common:
147               raw_data: {get_file: hieradata/common.yaml}
148             volume:
149               raw_data: {get_file: hieradata/volume.yaml}
150               oac_data:
151                 cinder::volume::iscsi::iscsi_ip_address: local-ipv4
152               mapped_data:
153                 # Cinder
154                 cinder::setup_test_volume::size: {get_input: cinder_lvm_loop_device_size}
155                 cinder::volume::iscsi::iscsi_helper: {get_input: cinder_iscsi_helper}
156                 cinder::database_connection: {get_input: cinder_dsn}
157                 cinder::rabbit_hosts: {get_input: rabbit_hosts}
158                 cinder::rabbit_userid: {get_input: rabbit_username}
159                 cinder::rabbit_password: {get_input: rabbit_password}
160                 ntp::servers: {get_input: ntp_servers}
161                 enable_package_install: {get_input: enable_package_install}
162
163 outputs:
164   hosts_entry:
165     value:
166       str_replace:
167         template: "IP HOST HOST.novalocal"
168         params:
169           IP: {get_attr: [BlockStorage, networks, ctlplane, 0]}
170           HOST: {get_attr: [BlockStorage, name]}