From 51bc769c9af31058a831a3e259cce64095db3a9c Mon Sep 17 00:00:00 2001 From: Dmitry Pyzhov Date: Tue, 15 Jan 2013 15:41:14 +0400 Subject: [PATCH] Restore swift+puppetdb --- iso/bootstrap_admin_node.sh | 3 ++ puppet/nailgun/examples/site.pp | 1 - puppet/osnailyfacter/manifests/cluster_ha.pp | 31 ++++++++++++++++--- puppet/puppetmaster/templates/puppet.conf.erb | 14 ++++----- requirements-rpm.txt | 3 ++ test/integration/__init__.py | 2 +- test/integration/test_node.py | 6 ++-- 7 files changed, 44 insertions(+), 16 deletions(-) diff --git a/iso/bootstrap_admin_node.sh b/iso/bootstrap_admin_node.sh index 0c2368ccc..3377dd492 100644 --- a/iso/bootstrap_admin_node.sh +++ b/iso/bootstrap_admin_node.sh @@ -1,5 +1,8 @@ #!/bin/bash puppet apply --modulepath=/opt/nailgun_puppet /opt/nailgun_puppet/nailgun/examples/site.pp 2>&1 | tee /var/log/puppet/firstboot.log +puppet apply -e 'class {puppetdb:}' +sed -i -e s/8080/8082/ /etc/puppetdb/conf.d/jetty.ini +puppet apply -e 'class {puppetdb::master::config: puppet_service_name=>"puppetmaster"}' sed -i --follow-symlinks "/bootstrap_admin_node.sh/d" /etc/rc.local diff --git a/puppet/nailgun/examples/site.pp b/puppet/nailgun/examples/site.pp index 21d2806b2..2a30a9587 100644 --- a/puppet/nailgun/examples/site.pp +++ b/puppet/nailgun/examples/site.pp @@ -56,5 +56,4 @@ node default { rabbitmq_naily_password => $rabbitmq_naily_password, puppet_master_hostname => $puppet_master_hostname, } - } diff --git a/puppet/osnailyfacter/manifests/cluster_ha.pp b/puppet/osnailyfacter/manifests/cluster_ha.pp index 2a49c3e66..2157f7fbc 100644 --- a/puppet/osnailyfacter/manifests/cluster_ha.pp +++ b/puppet/osnailyfacter/manifests/cluster_ha.pp @@ -12,7 +12,7 @@ $quantum = false $manage_volumes = false $cinder = false $auto_assign_floating_ip = false -$glance_backend = 'file' +$glance_backend = 'swift' $network_manager = 'nova.network.manager.FlatDHCPManager' @@ -27,6 +27,8 @@ $nova_db_password = 'nova' $nova_user_password = 'nova' $rabbit_password = 'nova' $rabbit_user = 'nova' +$swift_shared_secret = 'changeme' +$swift_user_password = 'swift_pass' $quantum_user_password = 'quantum_pass' # Quantum is turned off $quantum_db_password = 'quantum_pass' # Quantum is turned off $quantum_db_user = 'quantum' # Quantum is turned off @@ -72,7 +74,7 @@ class compact_controller { memcached_servers => $controller_hostnames, export_resources => false, glance_backend => $glance_backend, - #swift_proxies => $swift_proxies, + swift_proxies => $controller_internal_addresses, quantum => $quantum, quantum_user_password => $quantum_user_password, quantum_db_password => $quantum_db_password, @@ -85,6 +87,12 @@ class compact_controller { galera_nodes => $galera_nodes, nv_physical_volume => $nv_physical_volume, } + class { 'swift::keystone::auth': + password => $swift_user_password, + public_address => $public_vip, + internal_address => $management_vip, + admin_address => $management_vip, + } } @@ -93,14 +101,29 @@ class compact_controller { include osnailyfacter::test_controller class { compact_controller: } + class { 'openstack::swift::storage-node': + storage_type => 'loopback', + swift_zone => $uid, + swift_local_net_ip => $internal_address, + } + class { 'openstack::swift::proxy': + swift_proxies => $controller_internal_addresses, + swift_master => $master_hostname, + controller_node_address => $management_vip, + swift_local_net_ip => $internal_address, + } class { 'openstack::img::cirros': os_password => $admin_password, os_auth_url => "http://${management_vip}:5000/v2.0/", img_name => "TestVM", } - Class[osnailyfacter::network_setup] -> Class[openstack::controller_ha] - Class[glance::api] -> Class[openstack::img::cirros] + Class[osnailyfacter::network_setup] -> Class[openstack::controller_ha] + Class[osnailyfacter::network_setup] -> Class[openstack::swift::storage-node] + Class[osnailyfacter::network_setup] -> Class[openstack::swift::proxy] + Class[glance::api] -> Class[openstack::img::cirros] + Class[openstack::swift::storage-node] -> Class[openstack::img::cirros] + Class[openstack::swift::proxy] -> Class[openstack::img::cirros] } "compute" : { diff --git a/puppet/puppetmaster/templates/puppet.conf.erb b/puppet/puppetmaster/templates/puppet.conf.erb index 0a90b8e7f..0ab8b8b54 100644 --- a/puppet/puppetmaster/templates/puppet.conf.erb +++ b/puppet/puppetmaster/templates/puppet.conf.erb @@ -36,11 +36,11 @@ certname = <%= puppet_master_hostname %> storeconfigs = true - dbadapter = mysql - dbname = <%= puppet_stored_dbname %> - dbuser = <%= puppet_stored_dbuser %> - dbpassword = <%= puppet_stored_dbpassword %> - dbserver = localhost - dbsocket = <%= puppet_stored_dbsocket %> + #dbadapter = mysql + #dbname = <%= puppet_stored_dbname %> + #dbuser = <%= puppet_stored_dbuser %> + #dbpassword = <%= puppet_stored_dbpassword %> + #dbserver = localhost + #dbsocket = <%= puppet_stored_dbsocket %> configtimeout = 1200 - \ No newline at end of file + diff --git a/requirements-rpm.txt b/requirements-rpm.txt index b5e8effd2..1e435bde4 100644 --- a/requirements-rpm.txt +++ b/requirements-rpm.txt @@ -49,8 +49,11 @@ openstack-swift-object openstack-swift-proxy patch policycoreutils +postgresql-server puppet-2.7.19 puppet-server-2.7.19 +puppetdb +puppetdb-terminus python-amqp python-cinder python-devel.x86_64 diff --git a/test/integration/__init__.py b/test/integration/__init__.py index 7ec8ce643..d31de1ec0 100644 --- a/test/integration/__init__.py +++ b/test/integration/__init__.py @@ -63,7 +63,7 @@ class Ci(object): node.boot = ['disk', 'cdrom'] environment.nodes.append(node) - for n in range(4): + for n in range(5): nodex = Node('slave%d' % (n + 1)) nodex.memory = 768 nodex.vnc = True diff --git a/test/integration/test_node.py b/test/integration/test_node.py index 8741fab2f..eab9205cf 100644 --- a/test/integration/test_node.py +++ b/test/integration/test_node.py @@ -132,14 +132,14 @@ class TestNode(Base): ret = ctrl_ssh.execute('/usr/bin/nova-manage service list') return ( (ret['exit_status'] == 0) - and (''.join(ret['stdout']).count(":-)") == 10) + and (''.join(ret['stdout']).count(":-)") == 13) and (''.join(ret['stdout']).count("XXX") == 0) ) self._revert_nodes() cluster_name = 'ha_cluster' nodes = { - 'controller': ['slave1', 'slave2'], - 'compute': ['slave3', 'slave4'] + 'controller': ['slave1', 'slave2', 'slave3'], + 'compute': ['slave4', 'slave5'] } self._basic_provisioning(cluster_name, nodes) slave = ci.environment.node['slave1']