-
Notifications
You must be signed in to change notification settings - Fork 88
/
site.pp
151 lines (126 loc) · 5.31 KB
/
site.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
#
# This document serves as an example of how to deploy
# basic single and multi-node openstack environments.
#
# deploy a script that can be used to test nova
class { 'openstack::test_file': }
####### shared variables ##################
# this section is used to specify global variables that will
# be used in the deployment of multi and single node openstack
# environments
# assumes that eth0 is the public interface
$public_interface = 'eth0'
# assumes that eth1 is the interface that will be used for the vm network
# this configuration assumes this interface is active but does not have an
# ip address allocated to it.
$private_interface = 'eth1'
# credentials
$admin_email = 'root@localhost'
$admin_password = 'keystone_admin'
$keystone_db_password = 'keystone_db_pass'
$keystone_admin_token = 'keystone_admin_token'
$nova_db_password = 'nova_pass'
$nova_user_password = 'nova_pass'
$glance_db_password = 'glance_pass'
$glance_user_password = 'glance_pass'
$rabbit_password = 'openstack_rabbit_password'
$rabbit_user = 'openstack_rabbit_user'
$fixed_network_range = '10.0.0.0/24'
$floating_network_range = '192.168.101.64/28'
# switch this to true to have all service log at verbose
$verbose = false
# by default it does not enable atomatically adding floating IPs
$auto_assign_floating_ip = false
#### end shared variables #################
# all nodes whose certname matches openstack_all should be
# deployed as all-in-one openstack installations.
node /openstack_all/ {
include 'apache'
class { 'openstack::all':
public_address => $ipaddress_eth0,
public_interface => $public_interface,
private_interface => $private_interface,
admin_email => $admin_email,
admin_password => $admin_password,
keystone_db_password => $keystone_db_password,
keystone_admin_token => $keystone_admin_token,
nova_db_password => $nova_db_password,
nova_user_password => $nova_user_password,
glance_db_password => $glance_db_password,
glance_user_password => $glance_user_password,
rabbit_password => $rabbit_password,
rabbit_user => $rabbit_user,
libvirt_type => 'kvm',
floating_range => $floating_network_range,
fixed_range => $fixed_network_range,
verbose => $verbose,
auto_assign_floating_ip => $auto_assign_floating_ip,
}
class { 'openstack::auth_file':
admin_password => $admin_password,
keystone_admin_token => $keystone_admin_token,
controller_node => '127.0.0.1',
}
}
# multi-node specific parameters
$controller_node_address = '192.168.101.11'
$controller_node_public = $controller_node_address
$controller_node_internal = $controller_node_address
$sql_connection = "mysql://nova:${nova_db_password}@${controller_node_internal}/nova"
node /openstack_controller/ {
# class { 'nova::volume': enabled => true }
# class { 'nova::volume::iscsi': }
class { 'openstack::controller':
public_address => $controller_node_public,
public_interface => $public_interface,
private_interface => $private_interface,
internal_address => $controller_node_internal,
floating_range => $floating_network_range,
fixed_range => $fixed_network_range,
# by default it does not enable multi-host mode
multi_host => true,
# by default is assumes flat dhcp networking mode
network_manager => 'nova.network.manager.FlatDHCPManager',
verbose => $verbose,
auto_assign_floating_ip => $auto_assign_floating_ip,
mysql_root_password => $mysql_root_password,
admin_email => $admin_email,
admin_password => $admin_password,
keystone_db_password => $keystone_db_password,
keystone_admin_token => $keystone_admin_token,
glance_db_password => $glance_db_password,
glance_user_password => $glance_user_password,
nova_db_password => $nova_db_password,
nova_user_password => $nova_user_password,
rabbit_password => $rabbit_password,
rabbit_user => $rabbit_user,
export_resources => false,
}
class { 'openstack::auth_file':
admin_password => $admin_password,
keystone_admin_token => $keystone_admin_token,
controller_node => $controller_node_internal,
}
}
node /openstack_compute/ {
class { 'openstack::compute':
public_interface => $public_interface,
private_interface => $private_interface,
internal_address => $ipaddress_eth0,
libvirt_type => 'kvm',
fixed_range => $fixed_network_range,
network_manager => 'nova.network.manager.FlatDHCPManager',
multi_host => true,
sql_connection => $sql_connection,
nova_user_password => $nova_user_password,
rabbit_host => $controller_node_internal,
rabbit_password => $rabbit_password,
rabbit_user => $rabbit_user,
glance_api_servers => "${controller_node_internal}:9292",
vncproxy_host => $controller_node_public,
vnc_enabled => true,
verbose => $verbose,
manage_volumes => true,
nova_volume => 'nova-volumes'
}
}