Skip to content

Commit

Permalink
New branch multi-nodes adding a networker.pp for dedicated neutron ne…
Browse files Browse the repository at this point in the history
…twork node

Havana2+/Foreman1.2+
Initial commit
  • Loading branch information
gildub committed Sep 6, 2013
1 parent 6c503e6 commit 0622579
Show file tree
Hide file tree
Showing 4 changed files with 225 additions and 77 deletions.
163 changes: 99 additions & 64 deletions puppet/modules/quickstack/manifests/compute.pp
Original file line number Diff line number Diff line change
@@ -1,79 +1,114 @@
# Common quickstack configurations
class quickstack::compute (
$fixed_network_range = $quickstack::params::fixed_network_range,
$floating_network_range = $quickstack::params::floating_network_range,
$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,
$private_interface = $quickstack::params::private_interface,
$public_interface = $quickstack::params::public_interface,
$verbose = $quickstack::params::verbose,
$floating_network_range = $quickstack::params::floating_network_range,
$neutron_db_password = $quickstack::params::neutron_db_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,
$private_interface = $quickstack::params::private_interface,
$public_interface = $quickstack::params::public_interface,
$verbose = $quickstack::params::verbose,
) inherits quickstack::params {

# Configure Nova
nova_config{
'DEFAULT/auto_assign_floating_ip': value => 'True';
#"DEFAULT/network_host": value => ${pacemaker_priv_floating_ip;
"DEFAULT/network_host": value => "$::ipaddress";
"DEFAULT/libvirt_inject_partition": value => "-1";
#"DEFAULT/metadata_host": value => "$pacemaker_priv_floating_ip";
"DEFAULT/metadata_host": value => "$::ipaddress";
"DEFAULT/multi_host": value => "True";
# Configure Nova
nova_config{
'DEFAULT/auto_assign_floating_ip': value => 'True';
#"DEFAULT/network_host": value => ${pacemaker_priv_floating_ip;
"DEFAULT/network_host": value => "$::ipaddress";
"DEFAULT/libvirt_inject_partition": value => "-1";
#"DEFAULT/metadata_host": value => "$pacemaker_priv_floating_ip";
"DEFAULT/metadata_host": value => "$::ipaddress";
"DEFAULT/multi_host": value => "True";
}

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',
qpid_hostname => $pacemaker_priv_floating_ip,
verbose => $verbose,
}
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',
qpid_hostname => $pacemaker_priv_floating_ip,
verbose => $verbose,
}

# uncomment if on a vm
# GSutclif: Maybe wrap this in a Facter['is-virtual'] test ?
#file { "/usr/bin/qemu-system-x86_64":
# ensure => link,
# target => "/usr/libexec/qemu-kvm",
# notify => Service["nova-compute"],
#}
#nova_config{
# "libvirt_cpu_mode": value => "none";
#}
# uncomment if on a vm
# GSutclif: Maybe wrap this in a Facter['is-virtual'] test ?
#file { "/usr/bin/qemu-system-x86_64":
# ensure => link,
# target => "/usr/libexec/qemu-kvm",
# notify => Service["nova-compute"],
#}
#nova_config{
# "libvirt_cpu_mode": value => "none";
#}

class { 'nova::compute::libvirt':
#libvirt_type => "qemu", # uncomment if on a vm
vncserver_listen => "$::ipaddress",
}
class { 'nova::compute::libvirt':
#libvirt_type => "qemu", # uncomment if on a vm
vncserver_listen => $::ipaddress,
}

class {"nova::compute":
enabled => true,
vncproxy_host => "$pacemaker_priv_floating_ip",
vncserver_proxyclient_address => "$ipaddress",
}
class {"nova::compute":
enabled => true,
vncproxy_host => $pacemaker_pub_floating_ip,
vncserver_proxyclient_address => $::ipaddress,
}

class { 'nova::api':
enabled => true,
admin_password => "$nova_user_password",
auth_host => "$pacemaker_priv_floating_ip",
}
class { 'nova::api':
enabled => true,
admin_password => $nova_user_password,
auth_host => $pacemaker_priv_floating_ip,
}

class { 'nova::network':
private_interface => "$private_interface",
public_interface => "$public_interface",
fixed_range => "$fixed_network_range",
floating_range => "$floating_network_range",
network_manager => "nova.network.manager.FlatDHCPManager",
config_overrides => {"force_dhcp_release" => false},
create_networks => true,
enabled => true,
install_service => true,
}
#class { 'nova::network':
# private_interface => "$private_interface",
# public_interface => "$public_interface",
# fixed_range => "$fixed_network_range",
# floating_range => "$floating_network_range",
# network_manager => "nova.network.manager.FlatDHCPManager",
# config_overrides => {"force_dhcp_release" => false},
# create_networks => true,
# enabled => true,
# install_service => true,
#}

firewall { '001 nove compute incoming':
proto => 'tcp',
dport => '5900-5999',
action => 'accept',
}
### Neutron
class { '::neutron':
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";
}

Neutron_config<||>

# Plugin
class { '::neutron::plugins::ovs':
sql_connection => "mysql:https://neutron:${neutron_db_password}@${pacemaker_priv_floating_ip}/neutron",
tenant_network_type => 'gre',
}

# Agent
class { '::neutron::agents::ovs':
local_ip => $::ipaddress,
enable_tunneling => true,
}

class { '::nova::network::neutron':
neutron_admin_password => $admin_password,
neutron_admin_tenant_name => 'admin',
neutron_admin_username => 'admin',
neutron_url => 'http:https://192.168.0.11:9696',
neutron_admin_auth_url => 'http:https://192.168.0.11:35357/v2.0',
}

firewall { '001 nova compute incoming':
proto => 'tcp',
dport => '5900-5999',
action => 'accept',
}
}
69 changes: 56 additions & 13 deletions puppet/modules/quickstack/manifests/controller.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
$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,
$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,
Expand Down Expand Up @@ -47,7 +48,7 @@
glance_db_password => $glance_db_password,
nova_db_password => $nova_db_password,
cinder_db_password => $cinder_db_password,
neutron_db_password => '',
neutron_db_password => $neutron_db_password,

# MySQL
mysql_bind_address => '0.0.0.0',
Expand All @@ -57,9 +58,9 @@
cinder => false,

# neutron
neutron => false,
neutron => true,

allowed_hosts => '%',
allowed_hosts => ['%','host11.internal.oslab.priv'],
enabled => true,
}

Expand All @@ -76,7 +77,7 @@
glance_user_password => $glance_user_password,
nova_user_password => $nova_user_password,
cinder_user_password => $cinder_user_password,
neutron_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,
Expand All @@ -92,10 +93,10 @@
}

class {'openstack::glance':
db_host => $pacemaker_priv_floating_ip,
db_host => $pacemaker_priv_floating_ip,
user_password => $glance_user_password,
db_password => $glance_db_password,
require => Class['openstack::db::mysql'],
require => Class['openstack::db::mysql'],
}

# Configure Nova
Expand Down Expand Up @@ -147,20 +148,62 @@

class {'memcached':}

# Double definition - This seems to have appeared with Puppet 3.x
# class {'apache':}
# class {'apache::mod::wsgi':}
# file { '/etc/httpd/conf.d/openstack-dashboard.conf':}
### 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,
auth_tenant => 'admin',
auth_user => 'admin',
}

neutron_plugin_ovs {
'OVS/enable_tunneling': value => 'True';
# 'keystone_authtoken/signing_dir': value => '/var/lib/neutron/keystone-signing';
}

# 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 => $admin_password,
neutron_admin_tenant_name => 'admin',
neutron_admin_username => 'admin',
}

firewall { '001 controller incoming':
proto => 'tcp',
# need to refine this list
dport => ['80', '3306', '5000', '35357', '5672', '8773', '8774', '8775', '8776', '9292', '6080'],
dport => ['80', '3306', '5000', '35357', '5672', '8773', '8774', '8775', '8776', '9292', '6080', '9696'],
action => 'accept',
}

if ($::selinux != "false"){
selboolean{'httpd_can_network_connect':
selboolean { 'httpd_can_network_connect':
value => on,
persistent => true,
}
Expand Down
68 changes: 68 additions & 0 deletions puppet/modules/quickstack/manifests/networker.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@

class quickstack::networker (
$fixed_network_range = $quickstack::params::fixed_network_range,
$floating_network_range = $quickstack::params::floating_network_range,
$neutron_db_password = $quickstack::params::neutron_db_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,
$private_interface = $quickstack::params::private_interface,
$public_interface = $quickstack::params::public_interface,
$verbose = $quickstack::params::verbose,
) inherits quickstack::params {

### Neutron stuf
# Configures everything in neutron.conf
class { '::neutron':
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";
}

Neutron_config<||>

# OVS Plugin
class { '::neutron::plugins::ovs':
sql_connection => "mysql:https://neutron:${neutron_db_password}@${pacemaker_priv_floating_ip}/neutron",
tenant_network_type => 'gre',
}

# Agents
class { '::neutron::agents::ovs':
local_ip => $::ipaddress,
enable_tunneling => true,
}

class { '::neutron::agents::dhcp': }

class { '::neutron::agents::l3': }

#class { 'neutron::agents::lbaas': }

#class { 'neutron::agents::fwaas': }

# Neutron external network for br-ex
#keystone_tenant { 'admin':
# ensure => present,
#}

#neutron_network { 'public':
# ensure => present,
# router_external => 'True',
# tenant_name => 'admin',

#neutron_subnet { 'public_subnet':
# ensure => 'present',
# cidr => '10.16.16.0/22',
# gateway_ip => '10.16.19.254',
# allocation_pools => 'start=10.16.18.1,end=10.16.18.254',
# network_name => 'public',
# tenant_name => 'admin',
#}
}
2 changes: 2 additions & 0 deletions puppet/modules/quickstack/manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
$keystone_admin_token = 'CHANGEME'
$keystone_db_password = 'CHANGEME'
$mysql_root_password = 'CHANGEME'
$neutron_db_password = 'CHANGEME'
$neutron_user_password = 'CHANGEME'
$nova_db_password = 'CHANGEME'
$nova_user_password = 'CHANGEME'

Expand Down

0 comments on commit 0622579

Please sign in to comment.