-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlbaasv2.yaml
65 lines (53 loc) · 3.12 KB
/
lbaasv2.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
heat_template_version: 2014-10-16
description: >
Post Lbaasv2 configuration
parameters:
servers:
type: json
input_values:
type: json
resources:
ExtraConfigLbaasv2:
type: OS::Heat::SoftwareConfig
properties:
group: script
config: |
#!/bin/sh
#where neutron-server is running
yum install openstack-neutron-lbaas
crudini --set /etc/neutron/neutron_lbaas.conf service_providers service_provider LOADBALANCERV2:Haproxy:neutron_lbaas.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default
plugins=$(crudini --get /etc/neutron/neutron.conf DEFAULT service_plugins)
if ! echo $plugins | grep --quiet lbaasv2; then
crudini --set /etc/neutron/neutron.conf DEFAULT service_plugins $plugins,lbaasv2
fi
neutron-db-manage --subproject neutron-lbaas upgrade head
systemctl restart neutron-server.service
#where lbaas agent is running
crudini --set /etc/neutron/lbaas_agent.ini DEFAULT device_driver
crudini --set /etc/neutron/lbaas_agent.ini DEFAULT user_group haproxy
crudini --set /etc/neutron/services_lbaas.conf haproxy user_group haproxy
crudini --set /etc/neutron/lbaas_agent.ini DEFAULT interface_driver neutron.agent.linux.interface.OVSInterfaceDriver
crudini --set /etc/neutron/lbaas_agent.ini DEFAULT device_driver neutron_lbaas.drivers.haproxy.namespace_driver.HaproxyNSDriver
systemctl restart neutron-lbaasv2-agent.service
systemctl enable neutron-lbaasv2-agent.service
echo "---Results---" >> /tmp/lbaasv2.out
#where neutron-server is running
echo "neutron_lbaas.conf service_provider=$(crudini --get /etc/neutron/neutron_lbaas.conf service_providers service_provider)" >> /tmp/lbaasv2.out
plugins=$(crudini --get /etc/neutron/neutron.conf DEFAULT service_plugins)
echo "neutron.conf service_plugins=$(crudini --get /etc/neutron/neutron.conf DEFAULT service_plugins)" >> /tmp/lbaasv2.out
#where lbaas agent is running
echo "lbaas_agent.ini device_driver=$(crudini --get /etc/neutron/lbaas_agent.ini DEFAULT device_driver)" >> /tmp/lbaasv2.out
echo "lbaas_agent.ini user_group=$(crudini --get /etc/neutron/lbaas_agent.ini DEFAULT user_group )" >> /tmp/lbaasv2.out
echo "lbaas_agent.ini interface_driver=$(crudini --get /etc/neutron/lbaas_agent.ini DEFAULT interface_driver)" >> /tmp/lbaasv2.out
echo "lbaas_agent.ini device_driver=$(crudini --get /etc/neutron/lbaas_agent.ini DEFAULT device_driver)" >> /tmp/lbaasv2.out
echo "neutron-server $(systemctl is-active neutron-server)" >> /tmp/lbaasv2.out
echo "neutron-lbaasv2-agent $(systemctl is-active neutron-lbaasv2-agent)" >> /tmp/lbaasv2.out
cat /tmp/lbaasv2.out
ExtraDeploymentsLbaasv2:
type: OS::Heat::SoftwareDeploymentGroup
properties:
name: ExtraDeploymentsLbaasv2
servers: {get_param: [servers, 'Controller']}
config: {get_resource: ExtraConfigLbaasv2}
input_values: {get_param: input_values}
actions: ['CREATE','UPDATE']