ea032b96a7508a866ccf72192ea9492d53d6b162
[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   PartPower:
74     default: 10
75     description: Partition Power to use when building Swift rings
76     type: number
77   Password:
78     default: unset
79     description: The password for the swift service account, used by the swift proxy
80       services.
81     hidden: true
82     type: string
83   Replicas:
84     type: number
85     default: 1
86     description: How many replicas to use in the swift rings.
87   SnmpdReadonlyUserName:
88     default: ro_snmp_user
89     description: The user name for SNMPd with readonly rights running on all Overcloud nodes
90     type: string
91   SnmpdReadonlyUserPassword:
92     default: unset
93     description: The user password for SNMPd with readonly rights running on all Overcloud nodes
94     type: string
95     hidden: true
96
97 resources:
98   SwiftConfig:
99     type: OS::Heat::StructuredConfig
100     properties:
101       group: os-apply-config
102       config:
103         snmpd:
104           export_MIB: UCD-SNMP-MIB
105           readonly_user_name: {get_input: snmpd_readonly_user_name}
106           readonly_user_password: {get_input: snmpd_readonly_user_password}
107         swift:
108           hash: { get_input: swift_hash_suffix }
109           part-power: { get_input: swift_part_power }
110           replicas: {get_input: swift_replicas }
111           service-password: { get_input: swift_password }
112         neutron:
113           enable_tunnelling: {get_param: NeutronEnableTunnelling}
114           tenant_network_type: {get_param: NeutronNetworkType}
115           ovs:
116             local_ip: { get_input: neutron_local_ip }
117   SwiftStorage:
118     type: OS::Nova::Server
119     properties:
120       image: {get_param: Image}
121       flavor: {get_param: Flavor}
122       key_name: {get_param: KeyName}
123       user_data_format: SOFTWARE_CONFIG
124       networks:
125         - network: ctlplane
126   SwiftKeystoneConfig:
127     type: OS::Heat::StructuredConfig
128     properties:
129       config:
130         keystone:
131           host: {get_input: keystone_host}
132   SwiftStorageKeystone:
133     type: OS::Heat::StructuredDeployment
134     properties:
135       server: {get_resource: SwiftStorage}
136       config: {get_resource: SwiftKeystoneConfig}
137       signal_transport: NO_SIGNAL
138       input_values:
139         keystone_host: {get_param: ControllerIP}
140   SwiftStorageDeploy:
141     type: OS::Heat::StructuredDeployment
142     properties:
143       server: {get_resource: SwiftStorage}
144       config: {get_resource: SwiftConfig}
145       signal_transport: NO_SIGNAL
146       input_values:
147         neutron_local_ip: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
148         snmpd_readonly_user_name: {get_param: SnmpdReadonlyUserName}
149         snmpd_readonly_user_password: {get_param: SnmpdReadonlyUserPassword}
150         swift_hash_suffix: {get_param: HashSuffix}
151         swift_mount_check: {get_param: MountCheck}
152         swift_password: {get_param: Password}
153         swift_part_power: {get_param: PartPower}
154         swift_replicas: { get_param: Replicas}
155
156 outputs:
157   hosts_entry:
158     value:
159       str_replace:
160         template: "IP HOST HOST.novalocal"
161         params:
162           IP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
163           HOST: {get_attr: [SwiftStorage, name]}
164   nova_server_resource:
165     description: Heat resource handle for the swift storage server
166     value:
167       {get_resource: SwiftStorage}
168   swift_device:
169     description: Swift device formatted for swift-ring-builder
170     value:
171       str_replace:
172         template: 'r1z1-IP:%PORT%/d1'
173         params:
174           IP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}