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