Merge "Add converted version of block and object storage"
[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     default: baremetal
47     description: Flavor for Swift storage nodes to request when deploying.
48     type: string
49   HashSuffix:
50     default: unset
51     description: A random string to be used as a salt when hashing to determine mappings
52       in the ring.
53     hidden: true
54     type: string
55   Image:
56     default: overcloud-swift-storage
57     type: string
58   KeyName:
59     default: default
60     description: Name of an existing EC2 KeyPair to enable SSH access to the instances
61     type: string
62   NeutronEnableTunnelling:
63     default: "True"
64     type: string
65   NeutronNetworkType:
66     default: gre
67     type: string
68   PartPower:
69     default: 10
70     description: Partition Power to use when building Swift rings
71     type: number
72   Password:
73     default: unset
74     description: The password for the swift service account, used by the swift proxy
75       services.
76     hidden: true
77     type: string
78   Replicas:
79     type: number
80     default: 1
81     description: How many replicas to use in the swift rings.
82   SnmpdReadonlyUserName:
83     default: ro_snmp_user
84     description: The user name for SNMPd with readonly rights running on all Overcloud nodes
85     type: string
86   SnmpdReadonlyUserPassword:
87     default: unset
88     description: The user password for SNMPd with readonly rights running on all Overcloud nodes
89     type: string
90     hidden: true
91
92 resources:
93   SwiftConfig:
94     type: OS::Heat::StructuredConfig
95     properties:
96       group: os-apply-config
97       config:
98         snmpd:
99           export_MIB: UCD-SNMP-MIB
100           readonly_user_name: {get_input: snmpd_readonly_user_name}
101           readonly_user_password: {get_input: snmpd_readonly_user_password}
102         swift:
103           hash: { get_input: swift_hash_suffix }
104           part-power: { get_input: swift_part_power }
105           replicas: {get_input: swift_replicas }
106           service-password: { get_input: swift_password }
107         neutron:
108           enable_tunnelling: {get_param: NeutronEnableTunnelling}
109           tenant_network_type: {get_param: NeutronNetworkType}
110           ovs:
111             local_ip: { get_input: neutron_local_ip }
112   SwiftStorage:
113     type: OS::Nova::Server
114     properties:
115       image: {get_param: Image}
116       flavor: {get_param: Flavor}
117       key_name: {get_param: KeyName}
118       user_data_format: SOFTWARE_CONFIG
119       networks:
120         - network: ctlplane
121   SwiftKeystoneConfig:
122     type: OS::Heat::StructuredConfig
123     properties:
124       config:
125         keystone:
126           host: {get_input: keystone_host}
127   SwiftStorageKeystone:
128     type: OS::Heat::StructuredDeployment
129     properties:
130       server: {get_resource: SwiftStorage}
131       config: {get_resource: SwiftKeystoneConfig}
132       signal_transport: NO_SIGNAL
133       input_values:
134         keystone_host: {get_param: ControllerIP}
135   SwiftStorageDeploy:
136     type: OS::Heat::StructuredDeployment
137     properties:
138       server: {get_resource: SwiftStorage}
139       config: {get_resource: SwiftConfig}
140       signal_transport: NO_SIGNAL
141       input_values:
142         neutron_local_ip: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
143         snmpd_readonly_user_name: {get_param: SnmpdReadonlyUserName}
144         snmpd_readonly_user_password: {get_param: SnmpdReadonlyUserPassword}
145         swift_hash_suffix: {get_param: HashSuffix}
146         swift_password: {get_param: Password}
147         swift_part_power: {get_param: PartPower}
148         swift_replicas: { get_param: Replicas}
149
150 outputs:
151   hosts_entry:
152     value:
153       str_replace:
154         template: "IP HOST HOST.novalocal"
155         params:
156           IP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
157           HOST: {get_attr: [SwiftStorage, name]}
158   nova_server_resource:
159     description: Heat resource handle for the swift storage server
160     value:
161       {get_resource: SwiftStorage}
162   swift_device:
163     description: Swift device formatted for swift-ring-builder
164     value:
165       str_replace:
166         template: 'r1z1-IP:%PORT%/d1'
167         params:
168           IP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}