Merge "Add parameter to manage usage of Neutron l3_ha option"
[apex-tripleo-heat-templates.git] / swift-storage.yaml
1 heat_template_version: 2014-10-16
2 description: 'Common Swift Storage Configuration'
3 parameters:
4   ControllerIP:
5     default: ''
6     type: string
7   ExtraConfig:
8     default: {}
9     description: |
10       Additional configuration to inject into the cluster. The JSON should have
11       the following structure:
12         {"FILEKEY":
13           {"config":
14             [{"section": "SECTIONNAME",
15               "values":
16                 [{"option": "OPTIONNAME",
17                   "value": "VALUENAME"
18                  }
19                 ]
20              }
21             ]
22           }
23         }
24       For instance:
25         {"nova":
26           {"config":
27             [{"section": "default",
28               "values":
29                 [{"option": "force_config_drive",
30                   "value": "always"
31                  }
32                 ]
33              },
34              {"section": "cells",
35               "values":
36                 [{"option": "driver",
37                   "value": "nova.cells.rpc_driver.CellsRPCDriver"
38                  }
39                 ]
40              }
41             ]
42           }
43         }
44     type: json
45   Flavor:
46     description: Flavor for Swift storage nodes to request when deploying.
47     type: string
48     constraints:
49       - custom_constraint: nova.flavor
50   HashSuffix:
51     default: unset
52     description: A random string to be used as a salt when hashing to determine mappings
53       in the ring.
54     hidden: true
55     type: string
56   Image:
57     default: overcloud-swift-storage
58     type: string
59   KeyName:
60     default: default
61     description: Name of an existing EC2 KeyPair to enable SSH access to the instances
62     type: string
63   MountCheck:
64     default: 'false'
65     description: Value of mount_check in Swift account/container/object -server.conf
66     type: boolean
67   NeutronEnableTunnelling:
68     default: "True"
69     type: string
70   NeutronNetworkType:
71     default: gre
72     type: string
73   MinPartHours:
74     type: number
75     default: 1
76     description: The minimum time (in hours) before a partition in a ring can be moved following a rebalance.
77   PartPower:
78     default: 10
79     description: Partition Power to use when building Swift rings
80     type: number
81   Password:
82     default: unset
83     description: The password for the swift service account, used by the swift proxy
84       services.
85     hidden: true
86     type: string
87   Replicas:
88     type: number
89     default: 1
90     description: How many replicas to use in the swift rings.
91   SnmpdReadonlyUserName:
92     default: ro_snmp_user
93     description: The user name for SNMPd with readonly rights running on all Overcloud nodes
94     type: string
95   SnmpdReadonlyUserPassword:
96     default: unset
97     description: The user password for SNMPd with readonly rights running on all Overcloud nodes
98     type: string
99     hidden: true
100
101 resources:
102   SwiftConfig:
103     type: OS::Heat::StructuredConfig
104     properties:
105       group: os-apply-config
106       config:
107         snmpd:
108           export_MIB: UCD-SNMP-MIB
109           readonly_user_name: {get_input: snmpd_readonly_user_name}
110           readonly_user_password: {get_input: snmpd_readonly_user_password}
111         swift:
112           hash: { get_input: swift_hash_suffix }
113           part-power: { get_input: swift_part_power }
114           min-part-hours: { get_input: swift_min_part_hours }
115           mount-check: { get_input: swift_mount_check }
116           replicas: {get_input: swift_replicas }
117           service-password: { get_input: swift_password }
118         neutron:
119           enable_tunnelling: {get_param: NeutronEnableTunnelling}
120           tenant_network_type: {get_param: NeutronNetworkType}
121           ovs:
122             local_ip: { get_input: neutron_local_ip }
123   SwiftStorage:
124     type: OS::Nova::Server
125     properties:
126       image: {get_param: Image}
127       flavor: {get_param: Flavor}
128       key_name: {get_param: KeyName}
129       user_data_format: SOFTWARE_CONFIG
130       networks:
131         - network: ctlplane
132   SwiftKeystoneConfig:
133     type: OS::Heat::StructuredConfig
134     properties:
135       config:
136         keystone:
137           host: {get_input: keystone_host}
138   SwiftStorageKeystone:
139     type: OS::Heat::StructuredDeployment
140     properties:
141       server: {get_resource: SwiftStorage}
142       config: {get_resource: SwiftKeystoneConfig}
143       signal_transport: NO_SIGNAL
144       input_values:
145         keystone_host: {get_param: ControllerIP}
146   SwiftStorageDeploy:
147     type: OS::Heat::StructuredDeployment
148     properties:
149       server: {get_resource: SwiftStorage}
150       config: {get_resource: SwiftConfig}
151       signal_transport: NO_SIGNAL
152       input_values:
153         neutron_local_ip: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
154         snmpd_readonly_user_name: {get_param: SnmpdReadonlyUserName}
155         snmpd_readonly_user_password: {get_param: SnmpdReadonlyUserPassword}
156         swift_hash_suffix: {get_param: HashSuffix}
157         swift_mount_check: {get_param: MountCheck}
158         swift_password: {get_param: Password}
159         swift_min_part_hours: {get_param: MinPartHours}
160         swift_part_power: {get_param: PartPower}
161         swift_replicas: { get_param: Replicas}
162
163 outputs:
164   hosts_entry:
165     value:
166       str_replace:
167         template: "IP HOST HOST.novalocal"
168         params:
169           IP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
170           HOST: {get_attr: [SwiftStorage, name]}
171   nova_server_resource:
172     description: Heat resource handle for the swift storage server
173     value:
174       {get_resource: SwiftStorage}
175   swift_device:
176     description: Swift device formatted for swift-ring-builder
177     value:
178       str_replace:
179         template: 'r1z1-IP:%PORT%/d1'
180         params:
181           IP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}