forked from vvaldez/astapor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
controller.pp
216 lines (181 loc) · 7.67 KB
/
controller.pp
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# TODO
# refine iptable rules, their probably giving access to the public
#
class quickstack::neutron::controller (
$admin_email = $quickstack::params::admin_email,
$admin_password = $quickstack::params::admin_password,
$cinder_db_password = $quickstack::params::cinder_db_password,
$cinder_user_password = $quickstack::params::cinder_user_password,
$glance_db_password = $quickstack::params::glance_db_password,
$glance_user_password = $quickstack::params::glance_user_password,
$horizon_secret_key = $quickstack::params::horizon_secret_key,
$keystone_admin_token = $quickstack::params::keystone_admin_token,
$keystone_db_password = $quickstack::params::keystone_db_password,
$mysql_root_password = $quickstack::params::mysql_root_password,
$neutron_db_password = $quickstack::params::neutron_db_password,
$neutron_user_password = $quickstack::params::neutron_user_password,
$nova_db_password = $quickstack::params::nova_db_password,
$nova_user_password = $quickstack::params::nova_user_password,
$pacemaker_priv_floating_ip = $quickstack::params::pacemaker_priv_floating_ip,
$pacemaker_pub_floating_ip = $quickstack::params::pacemaker_pub_floating_ip,
$verbose = $quickstack::params::verbose
) inherits quickstack::params {
#pacemaker::corosync { 'quickstack': }
#pacemaker::corosync::node { '10.100.0.2': }
#pacemaker::corosync::node { '10.100.0.3': }
#pacemaker::resources::ip { '8.21.28.222':
# address => '8.21.28.222',
#}
#pacemaker::resources::ip { '10.100.0.222':
# address => '10.100.0.222',
#}
#pacemaker::resources::lsb { 'qpidd': }
#pacemaker::stonith::ipmilan { $ipmi_address:
# address => $ipmi_address,
# user => $ipmi_user,
# password => $ipmi_pass,
# hostlist => $ipmi_host_list,
#}
class {'openstack::db::mysql':
mysql_root_password => $mysql_root_password,
keystone_db_password => $keystone_db_password,
glance_db_password => $glance_db_password,
nova_db_password => $nova_db_password,
cinder_db_password => $cinder_db_password,
neutron_db_password => $neutron_db_password,
# MySQL
mysql_bind_address => '0.0.0.0',
mysql_account_security => true,
# Cinder
cinder => false,
# neutron
neutron => true,
allowed_hosts => ['%','host11.internal.oslab.priv'],
enabled => true,
}
class {'qpid::server':
auth => "no"
}
class {'openstack::keystone':
db_host => $pacemaker_priv_floating_ip,
db_password => $keystone_db_password,
admin_token => $keystone_admin_token,
admin_email => $admin_email,
admin_password => $admin_password,
glance_user_password => $glance_user_password,
nova_user_password => $nova_user_password,
cinder_user_password => $cinder_user_password,
neutron_user_password => $neutron_user_password,
public_address => $pacemaker_pub_floating_ip,
admin_address => $pacemaker_priv_floating_ip,
internal_address => $pacemaker_priv_floating_ip,
neutron => false,
cinder => false,
enabled => true,
require => Class['openstack::db::mysql'],
}
class { 'swift::keystone::auth':
password => $swift_admin_password,
address => $pacemaker_priv_floating_ip,
}
class {'openstack::glance':
db_host => $pacemaker_priv_floating_ip,
user_password => $glance_user_password,
db_password => $glance_db_password,
require => Class['openstack::db::mysql'],
}
# Configure Nova
class { 'nova':
sql_connection => "mysql:https://nova:${nova_db_password}@${pacemaker_priv_floating_ip}/nova",
image_service => 'nova.image.glance.GlanceImageService',
glance_api_servers => "http:https://${pacemaker_priv_floating_ip}:9292/v1",
rpc_backend => 'nova.openstack.common.rpc.impl_qpid',
verbose => $verbose,
require => Class['openstack::db::mysql', 'qpid::server'],
}
class { 'nova::api':
enabled => true,
admin_password => $nova_user_password,
auth_host => $pacemaker_priv_floating_ip,
neutron_metadata_proxy_shared_secret => 'shared_secret',
}
nova_config {
'DEFAULT/auto_assign_floating_ip': value => 'True';
'DEFAULT/multi_host': value => 'True';
'DEFAULT/force_dhcp_release': value => 'False';
'keystone_authtoken/admin_tenant_name': value => 'admin';
'keystone_authtoken/admin_user': value => 'admin';
'keystone_authtoken/admin_password': value => $admin_password;
'keystone_authtoken/auth_host': value => '127.0.0.1';
}
class { [ 'nova::scheduler', 'nova::cert', 'nova::consoleauth', 'nova::conductor' ]:
enabled => true,
}
class { 'nova::vncproxy':
host => '0.0.0.0',
enabled => true,
}
package {'horizon-packages':
name => ['python-memcached', 'python-netaddr'],
notify => Class['horizon'],
}
file {'/etc/httpd/conf.d/rootredirect.conf':
ensure => present,
content => 'RedirectMatch ^/$ /dashboard/',
notify => File['/etc/httpd/conf.d/openstack-dashboard.conf'],
}
class {'horizon':
secret_key => $horizon_secret_key,
keystone_host => $pacemaker_priv_floating_ip,
}
class {'memcached':}
### Neutron
# Configures everything in neutron.conf
class { '::neutron':
enabled => true,
verbose => true,
allow_overlapping_ips => true,
rpc_backend => 'neutron.openstack.common.rpc.impl_qpid',
qpid_hostname => $pacemaker_priv_floating_ip,
}
# To be done by neutron module
neutron_config {
'database/connection': value => "mysql:https://neutron:${neutron_db_password}@${pacemaker_priv_floating_ip}/neutron";
}
class { '::neutron::keystone::auth':
password => $admin_password,
public_address => $pacemaker_pub_floating_ip,
admin_address => $pacemaker_priv_floating_ip,
internal_address => $pacemaker_priv_floating_ip,
}
# The API server talks to keystone for authorisation
class { '::neutron::server':
auth_host => $::ipaddress,
auth_password => $admin_password,
}
neutron_plugin_ovs {
'OVS/enable_tunneling': value => 'True';
'SECURITYGROUP/firewall_driver':
value => 'neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver';
}
# Plugin
class { '::neutron::plugins::ovs':
sql_connection => "mysql:https://neutron:${neutron_db_password}@${pacemaker_priv_floating_ip}/neutron",
tenant_network_type => 'gre',
}
class { '::nova::network::neutron':
neutron_admin_password => $neutron_user_password,
}
firewall { '001 controller incoming':
proto => 'tcp',
# need to refine this list
dport => ['80', '3306', '5000', '35357', '5672', '8773', '8774', '8775', '8776', '9292', '6080', '9696'],
action => 'accept',
}
if ($::selinux != "false"){
selboolean { 'httpd_can_network_connect':
value => on,
persistent => true,
}
}
}