Renamed nailytest -> osnailyfacter
This commit is contained in:
parent
a24a331d94
commit
deb4a8824a
@ -152,7 +152,7 @@ mkdir -p /opt/nailgun_puppet
|
||||
tar zxf ${CD}/puppet-nailgun.tgz -C /opt/nailgun_puppet
|
||||
tar zxf ${CD}/puppet-slave.tgz -C /etc/puppet/modules
|
||||
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
|
||||
rm /etc/yum.repos.d/CentOS*.repo
|
||||
|
@ -90,7 +90,7 @@ $(ISOROOT)/puppet-nailgun.tgz:
|
||||
|
||||
$(ISOROOT)/puppet-slave.tgz:
|
||||
@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 ./*)
|
||||
gzip -c -9 $(BUILD_DIR)/puppet-slave.tar > $@
|
||||
|
||||
|
@ -1,119 +1,12 @@
|
||||
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 {
|
||||
"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" : {
|
||||
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]
|
||||
}
|
||||
}
|
||||
|
||||
|
25
puppet/osnailyfacter/examples/site.pp
Normal file
25
puppet/osnailyfacter/examples/site.pp
Normal 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
|
||||
}
|
14
puppet/osnailyfacter/lib/facter/naily.rb
Normal file
14
puppet/osnailyfacter/lib/facter/naily.rb
Normal 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
|
121
puppet/osnailyfacter/manifests/init.pp
Normal file
121
puppet/osnailyfacter/manifests/init.pp
Normal 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
|
||||
}
|
6
puppet/osnailyfacter/manifests/network_setup.pp
Normal file
6
puppet/osnailyfacter/manifests/network_setup.pp
Normal file
@ -0,0 +1,6 @@
|
||||
class osnailyfacter::network_setup {
|
||||
|
||||
include puppet-network
|
||||
create_resources(network_config,parsejson($network_data))
|
||||
}
|
||||
|
5
puppet/osnailyfacter/manifests/test_compute.pp
Normal file
5
puppet/osnailyfacter/manifests/test_compute.pp
Normal file
@ -0,0 +1,5 @@
|
||||
class nailytest::test_compute {
|
||||
file { "/tmp/compute-file":
|
||||
content => "Hello world! $role is installed",
|
||||
}
|
||||
}
|
5
puppet/osnailyfacter/manifests/test_controller.pp
Normal file
5
puppet/osnailyfacter/manifests/test_controller.pp
Normal file
@ -0,0 +1,5 @@
|
||||
class nailytest::test_controller {
|
||||
file { "/tmp/controller-file":
|
||||
content => "Hello world! $role is installed",
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user