forked from OpenStackCookbook/OpenStackCookbook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheat.sh
executable file
·133 lines (96 loc) · 3.24 KB
/
heat.sh
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#!/bin/bash
# heat.sh
# Authors: Kevin Jackson (@itarchitectkev)
# Source in common env vars
. /vagrant/common.sh
HEAT_SERVICE_USER=heat
HEAT_SERVICE_PASS=heat
##############################
# Chapter 9 - More OpenStack #
##############################
# Install Heat Things
sudo apt-get -y install heat-api heat-api-cfn heat-engine
MYSQL_ROOT_PASS=openstack
MYSQL_HEAT_PASS=openstack
mysql -uroot -p$MYSQL_ROOT_PASS -e 'CREATE DATABASE heat;'
mysql -uroot -p$MYSQL_ROOT_PASS -e "GRANT ALL PRIVILEGES ON heat.* TO 'heat'@'%' IDENTIFIED BY '$MYSQL_HEAT_PASS';"
# Configure Heat
HEAT_CONF=/etc/heat/heat.conf
cat > $HEAT_CONF <<EOF
[DEFAULT]
rabbit_host=
rabbit_port=5672
rabbit_userid=guest
rabbit_password=guest
rabbit_virtual_host=/
rabbit_ha_queues=false
use_syslog=false
log_dir=/var/log/heat
heat_watch_server_url = http://${CONTROLLER_HOST}:8003
heat_waitcondition_server_url = http://${CONTROLLER_HOST}:8000/v1/waitcondition
heat_metadata_server_url = http://${CONTROLLER_HOST}:8000
[clients]
endpoint_type = internalURL
[clients_ceilometer]
endpoint_type = internalURL
[clients_cinder]
endpoint_type = internalURL
[clients_heat]
endpoint_type = internalURL
[clients_keystone]
endpoint_type = internalURL
[clients_neutron]
endpoint_type = internalURL
[clients_nova]
endpoint_type = internalURL
[clients_swift]
endpoint_type = internalURL
[clients_trove]
endpoint_type = internalURL
[database]
backend=sqlalchemy
connection = mysql://heat:${MYSQL_HEAT_PASS}@${CONTROLLER_HOST}/heat
[keystone_authtoken]
auth_uri = https://${KEYSTONE_ADMIN_ENDPOINT}:35357/v2.0/
identity_uri = https://${KEYSTONE_ADMIN_ENDPOINT}:5000
admin_tenant_name = service
admin_user = ${HEAT_SERVICE_USER}
admin_password = ${HEAT_SERVICE_PASS}
#signing_dir = \$state_path/keystone-signing
insecure = True
[ec2authtoken]
auth_uri = http://${CONTROLLER_HOST}:5000/v2.0
[heat_api]
bind_port = 8004
[heat_api_cfn]
bind_port = 8000
[heat_api_cloudwatch]
bind_port = 8003
EOF
# /etc/heat/heat.conf
# Signing Dir
mkdir -p /var/cache/heat
chown heat:heat /var/cache/heat
chmod 0700 /var/cache/heat
heat-manage db_sync
keystone --insecure user-create --name=heat --pass=heat --email=heat@localhost
keystone --insecure user-role-add --user=heat --tenant=service --role=admin
keystone --insecure service-create --name=heat --type=orchestration --description="Heat Orchestration API"
ORCHESTRATION_SERVICE_ID=$(keystone service-list | awk '/\ orchestration\ / {print $2}')
keystone --insecure endpoint-create \
--region regionOne \
--service-id=${ORCHESTRATION_SERVICE_ID} \
--publicurl=http://${CONTROLLER_HOST}:8004/v1/$\(tenant_id\)s \
--internalurl=http://${CONTROLLER_HOST}:8004/v1/$\(tenant_id\)s \
--adminurl=http://${CONTROLLER_HOST}:8004/v1/$\(tenant_id\)s
keystone --insecure service-create --name=heat-cfn --type=cloudformation --description="Heat CloudFormation API"
CLOUDFORMATION_SERVICE_ID=$(keystone service-list | awk '/\ cloudformation\ / {print $2}')
keystone --insecure endpoint-create \
--region regionOne \
--service-id=${CLOUDFORMATION_SERVICE_ID} \
--publicurl=http://${CONTROLLER_HOST}:8000/v1/ \
--internalurl=http://${CONTROLLER_HOST}:8000/v1 \
--adminurl=http://${CONTROLLER_HOST}:8000/v1
service heat-api restart
service heat-api-cfn restart
service heat-engine restart