Renamed nailytest -> osnailyfacter

This commit is contained in:
Mike Scherbakov 2012-12-11 22:51:45 +04:00 committed by default
parent a24a331d94
commit deb4a8824a
9 changed files with 178 additions and 109 deletions

View File

@ -152,7 +152,7 @@ mkdir -p /opt/nailgun_puppet
tar zxf ${CD}/puppet-nailgun.tgz -C /opt/nailgun_puppet tar zxf ${CD}/puppet-nailgun.tgz -C /opt/nailgun_puppet
tar zxf ${CD}/puppet-slave.tgz -C /etc/puppet/modules tar zxf ${CD}/puppet-slave.tgz -C /etc/puppet/modules
mkdir -p /etc/puppet/manifests/ mkdir -p /etc/puppet/manifests/
cp /etc/puppet/modules/nailytest/examples/site.pp /etc/puppet/manifests/site.pp cp /etc/puppet/modules/osnailyfacter/examples/site.pp /etc/puppet/manifests/site.pp
# Prepare local repository specification # Prepare local repository specification
rm /etc/yum.repos.d/CentOS*.repo rm /etc/yum.repos.d/CentOS*.repo

View File

@ -90,7 +90,7 @@ $(ISOROOT)/puppet-nailgun.tgz:
$(ISOROOT)/puppet-slave.tgz: $(ISOROOT)/puppet-slave.tgz:
@rm -rf fuel/deployment/puppet/network @rm -rf fuel/deployment/puppet/network
(cd puppet && tar cf $(BUILD_DIR)/puppet-slave.tar puppet-network nailytest) (cd puppet && tar cf $(BUILD_DIR)/puppet-slave.tar puppet-network nailytest osnailyfacter)
(cd fuel/deployment/puppet && tar rf $(BUILD_DIR)/puppet-slave.tar ./*) (cd fuel/deployment/puppet && tar rf $(BUILD_DIR)/puppet-slave.tar ./*)
gzip -c -9 $(BUILD_DIR)/puppet-slave.tar > $@ gzip -c -9 $(BUILD_DIR)/puppet-slave.tar > $@

View File

@ -1,119 +1,12 @@
class nailytest { class nailytest {
# 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'
# switch this to true to have all service log at verbose
$verbose = true
# by default it does not enable atomatically adding floating IPs
$auto_assign_floating_ip = false
$manage_volumes = false # true
#$nv_physical_volume = ['/dev/sdz', '/dev/sdy', '/dev/sdx']
$cinder = false # true
$quantum = false # true
$quantum_user_password = 'quantum_pass'
$quantum_db_password = 'quantum_pass'
$quantum_db_user = 'quantum'
$quantum_db_dbname = 'quantum'
$mirror_type="external"
#stage { 'openstack-custom-repo': before => Stage['main'] }
#class { 'openstack::mirantis_repos': stage => 'openstack-custom-repo', type => $mirror_type }
$controller_node_internal = $controller_node_address
$quantum_host = $controller_node_address
$quantum_sql_connection = "mysql://${quantum_db_user}:${quantum_db_password}@${quantum_host}/${quantum_db_dbname}"
$sql_connection = "mysql://nova:${nova_db_password}@${controller_node_internal}/nova"
case $role { case $role {
"controller" : { "controller" : {
include nailytest::test_controller include nailytest::test_controller
class { 'openstack::controller':
admin_address => $controller_node_internal,
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,
quantum => $quantum,
quantum_user_password => $quantum_user_password,
quantum_db_password => $quantum_db_password,
quantum_db_user => $quantum_db_user,
quantum_db_dbname => $quantum_db_dbname,
cinder => $cinder,
manage_volumes => $manage_volumes,
nv_physical_volume => $nv_physical_volume,
}
class { 'openstack::auth_file':
admin_password => $admin_password,
keystone_admin_token => $keystone_admin_token,
controller_node => $controller_node_internal,
}
Class[nailytest::network_setup] -> Class[openstack::controller]
Class[nailytest::network_setup] -> Class[openstack::auth_file]
} }
"compute" : { "compute" : {
include nailytest::test_compute include nailytest::test_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_nodes => [$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,
#ssh_private_key => 'puppet:///ssh_keys/openstack',
#ssh_public_key => 'puppet:///ssh_keys/openstack.pub',
quantum => $quantum,
quantum_host => $quantum_host,
quantum_sql_connection => $quantum_sql_connection,
quantum_user_password => $quantum_user_password,
service_endpoint => $controller_node_internal,
verbose => $verbose,
}
Class[nailytest::network_setup] -> Class[openstack::compute]
} }
} }

View File

@ -0,0 +1,25 @@
#$public_interface = 'eth0' # Provided by Astute
$internal_interface = $management_interface # provided by Astute # 'eth0.102'
$private_interface = $fixed_interface # provided by Astute # 'eth0.103'
# It's provided by astute
#$fixed_network_range = '10.0.1.0/24'
#$floating_network_range = '10.0.204.128/28'
# It's provided by astute
#$controller_node_address = '10.0.0.2'
#$controller_node_public = '10.0.203.72'
$openstack_version = {
'keystone' => latest,
'glance' => latest,
'horizon' => latest,
'nova' => latest,
'novncproxy' => latest,
'cinder' => latest,
}
node default {
include osnailyfacter
}

View File

@ -0,0 +1,14 @@
require 'facter'
if File.exist?("/etc/naily.facts")
File.readlines("/etc/naily.facts").each do |line|
if line =~ /^(.+)=(.+)$/
var = $1.strip;
val = $2.strip
Facter.add(var) do
setcode { val }
end
end
end
end

View File

@ -0,0 +1,121 @@
class osnailyfacter {
# 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'
# switch this to true to have all service log at verbose
$verbose = true
# by default it does not enable atomatically adding floating IPs
$auto_assign_floating_ip = false
$manage_volumes = false # true
#$nv_physical_volume = ['/dev/sdz', '/dev/sdy', '/dev/sdx']
$cinder = false # true
$quantum = false # true
$quantum_user_password = 'quantum_pass'
$quantum_db_password = 'quantum_pass'
$quantum_db_user = 'quantum'
$quantum_db_dbname = 'quantum'
$mirror_type="external"
#stage { 'openstack-custom-repo': before => Stage['main'] }
#class { 'openstack::mirantis_repos': stage => 'openstack-custom-repo', type => $mirror_type }
$controller_node_internal = $controller_node_address
$quantum_host = $controller_node_address
$quantum_sql_connection = "mysql://${quantum_db_user}:${quantum_db_password}@${quantum_host}/${quantum_db_dbname}"
$sql_connection = "mysql://nova:${nova_db_password}@${controller_node_internal}/nova"
case $role {
"controller" : {
include osnailyfacter::test_controller
class { 'openstack::controller':
admin_address => $controller_node_internal,
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,
quantum => $quantum,
quantum_user_password => $quantum_user_password,
quantum_db_password => $quantum_db_password,
quantum_db_user => $quantum_db_user,
quantum_db_dbname => $quantum_db_dbname,
cinder => $cinder,
manage_volumes => $manage_volumes,
nv_physical_volume => $nv_physical_volume,
}
class { 'openstack::auth_file':
admin_password => $admin_password,
keystone_admin_token => $keystone_admin_token,
controller_node => $controller_node_internal,
}
Class[osnailyfacter::network_setup] -> Class[openstack::controller]
Class[osnailyfacter::network_setup] -> Class[openstack::auth_file]
}
"compute" : {
include osnailyfacter::test_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_nodes => [$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,
#ssh_private_key => 'puppet:///ssh_keys/openstack',
#ssh_public_key => 'puppet:///ssh_keys/openstack.pub',
quantum => $quantum,
quantum_host => $quantum_host,
quantum_sql_connection => $quantum_sql_connection,
quantum_user_password => $quantum_user_password,
service_endpoint => $controller_node_internal,
verbose => $verbose,
}
Class[osnailyfacter::network_setup] -> Class[openstack::compute]
}
}
include osnailyfacter::network_setup
}

View File

@ -0,0 +1,6 @@
class osnailyfacter::network_setup {
include puppet-network
create_resources(network_config,parsejson($network_data))
}

View File

@ -0,0 +1,5 @@
class nailytest::test_compute {
file { "/tmp/compute-file":
content => "Hello world! $role is installed",
}
}

View File

@ -0,0 +1,5 @@
class nailytest::test_controller {
file { "/tmp/controller-file":
content => "Hello world! $role is installed",
}
}