puppet: add debug mode for OpenStack services
[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       user_data_format: SOFTWARE_CONFIG
112       networks:
113         - network: ctlplane
114   SwiftStorageDeploy:
115     type: OS::Heat::StructuredDeployment
116     properties:
117       server: {get_resource: SwiftStorage}
118       config: {get_resource: SwiftConfig}
119       signal_transport: NO_SIGNAL
120       input_values:
121         neutron_local_ip: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
122         snmpd_readonly_user_name: {get_param: SnmpdReadonlyUserName}
123         snmpd_readonly_user_password: {get_param: SnmpdReadonlyUserPassword}
124         swift_hash_suffix: {get_param: HashSuffix}
125         swift_mount_check: {get_param: MountCheck}
126         swift_min_part_hours: {get_param: MinPartHours}
127         swift_part_power: {get_param: PartPower}
128         swift_replicas: { get_param: Replicas}
129
130 outputs:
131   hosts_entry:
132     value:
133       str_replace:
134         template: "IP HOST HOST.novalocal"
135         params:
136           IP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
137           HOST: {get_attr: [SwiftStorage, name]}
138   nova_server_resource:
139     description: Heat resource handle for the swift storage server
140     value:
141       {get_resource: SwiftStorage}
142   swift_device:
143     description: Swift device formatted for swift-ring-builder
144     value:
145       str_replace:
146         template: 'r1z1-IP:%PORT%/d1'
147         params:
148           IP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}