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