From 797072d0a2447cc85b49efb795979dcb2ccbd08c Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Wed, 15 Jul 2015 14:30:46 +0200 Subject: [PATCH 1/5] Organize the simple deploy composition layer * Align resource creation vs connections * Group by Openstack name components Signed-off-by: Bogdan Dobrelya --- example-puppet.py | 96 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 75 insertions(+), 21 deletions(-) diff --git a/example-puppet.py b/example-puppet.py index 232a3f6e..2d6185d2 100644 --- a/example-puppet.py +++ b/example-puppet.py @@ -18,10 +18,12 @@ GIT_PUPPET_LIBS_URL = 'https://github.com/CGenie/puppet-libs-resource' # TODO # Resource for repository OR puppet apt-module in run.pp # add-apt-repository cloud-archive:juno -# No copy of manifests, pull from upstream -# Official puppet manifests, not fuel-library # To discuss: install stuff in Docker container +# NOTE +# No copy of manifests, pull from upstream (implemented in the puppet handler) +# Official puppet manifests, not fuel-library + @click.group() def main(): @@ -42,6 +44,15 @@ def deploy(): openstack_rabbitmq_user = vr.create('openstack_rabbitmq_user', 'resources/rabbitmq_user/', {'user_name': 'openstack', 'password': 'openstack_password'})[0] mariadb_service1 = vr.create('mariadb_service1', 'resources/mariadb_service', {'image': 'mariadb', 'root_password': 'mariadb', 'port': 3306})[0] + + signals.connect(node1, mariadb_service1) + signals.connect(node1, rabbitmq_service1) + signals.connect(rabbitmq_service1, openstack_vhost) + signals.connect(rabbitmq_service1, openstack_rabbitmq_user) + signals.connect(openstack_vhost, openstack_rabbitmq_user, {'vhost_name': 'vhost_name'}) + + # KEYSTONE + keystone_puppet = vr.create('keystone_puppet', 'resources/keystone_puppet', {})[0] keystone_db = vr.create('keystone_db', 'resources/mariadb_keystone_db/', {'db_name': 'keystone_db', 'login_user': 'root'})[0] keystone_db_user = vr.create('keystone_db_user', 'resources/mariadb_keystone_user/', {'new_user_name': 'keystone', 'new_user_password': 'keystone', 'login_user': 'root'})[0] @@ -57,7 +68,6 @@ def deploy(): admin_tenant = vr.create('admin_tenant', 'resources/keystone_tenant', {'tenant_name': 'admin'})[0] admin_user = vr.create('admin_user', 'resources/keystone_user', {'user_name': 'admin', 'user_password': 'admin'})[0] admin_role = vr.create('admin_role', 'resources/keystone_role', {'role_name': 'admin'})[0] - services_tenant = vr.create('services_tenant', 'resources/keystone_tenant', {'tenant_name': 'services'})[0] neutron_keystone_user = vr.create('neutron_keystone_user', 'resources/keystone_user', {'user_name': 'neutron', 'user_password': 'neutron'})[0] neutron_keystone_role = vr.create('neutron_keystone_role', 'resources/keystone_role', {'role_name': 'neutron'})[0] @@ -94,6 +104,7 @@ def deploy(): signals.connect(node1, mariadb_service1) signals.connect(node1, keystone_db) signals.connect(node1, keystone_db_user) + signals.connect(node1, keystone_puppet) signals.connect(mariadb_service1, keystone_db, {'port': 'login_port', 'root_password': 'login_password'}) signals.connect(mariadb_service1, keystone_db_user, {'port': 'login_port', 'root_password': 'login_password'}) signals.connect(keystone_db, keystone_db_user, {'db_name': 'db_name'}) @@ -111,18 +122,24 @@ def deploy(): signals.connect(keystone_puppet, services_tenant) signals.connect(keystone_puppet, services_tenant, {'admin_port': 'keystone_port', 'ip': 'keystone_host'}) - signals.connect(services_tenant, neutron_keystone_user) - signals.connect(neutron_keystone_user, neutron_keystone_role) - - signals.connect(node1, keystone_puppet) + signals.connect(keystone_db, keystone_puppet, {'db_name': 'db_name'}) signals.connect(keystone_db_user, keystone_puppet, {'new_user_name': 'db_user', 'new_user_password': 'db_password'}) # NEUTRON + # TODO: vhost cannot be specified in neutron Puppet manifests so this user has to be admin anyways + neutron_puppet = vr.create('neutron_puppet', 'resources/neutron_puppet', {'rabbitmq_user': 'guest', 'rabbitmq_password': 'guest'})[0] + + neutron_keystone_user = vr.create('neutron_keystone_user', 'resources/keystone_user', {'user_name': 'neutron', 'user_password': 'neutron'})[0] + neutron_keystone_role = vr.create('neutron_keystone_role', 'resources/keystone_role', {'role_name': 'neutron'})[0] + neutron_keystone_service_endpoint = vr.create('neutron_keystone_service_endpoint', 'resources/keystone_service_endpoint', {'adminurl': 'http://{{admin_ip}}:{{admin_port}}', 'internalurl': 'http://{{internal_ip}}:{{internal_port}}', 'publicurl': 'http://{{public_ip}}:{{public_port}}', 'description': 'OpenStack Network Service', 'type': 'network'})[0] + signals.connect(node1, neutron_puppet) + signals.connect(rabbitmq_service1, neutron_puppet, {'ip': 'rabbitmq_host', 'port': 'rabbitmq_port'}) signals.connect(admin_user, neutron_puppet, {'user_name': 'keystone_user', 'user_password': 'keystone_password', 'tenant_name': 'keystone_tenant'}) signals.connect(keystone_puppet, neutron_puppet, {'ip': 'keystone_host', 'port': 'keystone_port'}) - + signals.connect(services_tenant, neutron_keystone_user) + signals.connect(neutron_keystone_user, neutron_keystone_role) signals.connect(neutron_puppet, neutron_keystone_service_endpoint, {'ip': 'ip', 'ssh_key': 'ssh_key', 'ssh_user': 'ssh_user'}) signals.connect(neutron_puppet, neutron_keystone_service_endpoint, {'ip': 'admin_ip', 'port': 'admin_port'}) signals.connect(neutron_puppet, neutron_keystone_service_endpoint, {'ip': 'internal_ip', 'port': 'internal_port'}) @@ -130,15 +147,49 @@ def deploy(): signals.connect(keystone_puppet, neutron_keystone_service_endpoint, {'ip': 'keystone_host', 'admin_port': 'keystone_admin_port', 'admin_token': 'admin_token'}) # CINDER - # signals.connect(node1, cinder_puppet) - # signals.connect(keystone_puppet, cinder_puppet, {'ip': 'keystone_host', 'port': 'keystone_port'}) + cinder_puppet = vr.create('cinder_puppet', 'resources/cinder_puppet', { + 'rabbit_userid': 'guest', 'rabbit_password': 'guest'})[0] + cinder_db = vr.create('cinder_db', 'resources/mariadb_db/', { + 'db_name': 'cinder_db', 'login_user': 'root'})[0] + cinder_db_user = vr.create('cinder_db_user', 'resources/mariadb_user/', { + 'user_name': 'cinder', 'user_password': 'cinder', 'login_user': 'root'})[0] + cinder_keystone_user = vr.create('cinder_keystone_user', 'resources/keystone_user', { + 'user_name': 'cinder', 'user_password': 'cinder'})[0] + cinder_keystone_role = vr.create('cinder_keystone_role', 'resources/keystone_role', { + 'role_name': 'cinder'})[0] + cinder_keystone_service_endpoint = vr.create( + 'cinder_keystone_service_endpoint', 'resources/keystone_service_endpoint', { + 'adminurl': 'http://{{admin_ip}}:{{admin_port}}', + 'internalurl': 'http://{{internal_ip}}:{{internal_port}}', + 'publicurl': 'http://{{public_ip}}:{{public_port}}', + 'description': 'OpenStack Network Service', 'type': 'network'})[0] - # signals.connect(services_tenant, cinder_keystone_user) - # signals.connect(cinder_keystone_user, cinder_keystone_role) - # signals.connect(cinder_keystone_user, cinder_puppet, {'user_name': 'keystone_user', 'user_password': 'keystone_password', 'tenant_name': 'keystone_tenant'}) + signals.connect(node1, cinder_db) + signals.connect(node1, cinder_db_user) + signals.connect(rabbitmq_service1, cinder_puppet, {'ip': 'rabbit_host', 'port': 'rabbit_port'}) + signals.connect(openstack_vhost, cinder_puppet, {'vhost_name': 'rabbit_virtual_host'}) + signals.connect(openstack_rabbitmq_user, cinder_puppet, {'user_name': 'rabbit_userid', 'password': 'rabbit_password'}) + signals.connect(mariadb_service1, cinder_db, { + 'port': 'login_port', 'root_password': 'login_password'}) + signals.connect(mariadb_service1, cinder_db_user, { + 'port': 'login_port', 'root_password': 'login_password'}) + signals.connect(cinder_db, cinder_db_user, {'db_name': 'db_name'}) + signals.connect(services_tenant, cinder_keystone_user) + signals.connect(cinder_keystone_user, cinder_keystone_role) + # NOVA + # #nova_network_puppet = vr.create('nova_network_puppet', GitProvider(GIT_PUPPET_LIBS_URL, 'nova_network'), {'rabbitmq_user': 'guest', 'rabbitmq_password': 'guest'})[0] + # # TODO: fix rabbitmq user/password + # nova_network_puppet = vr.create('nova_network_puppet', 'resources/nova_network_puppet', {'rabbitmq_user': 'guest', 'rabbitmq_password': 'guest'})[0] + + # nova_keystone_user = vr.create('nova_keystone_user', 'resources/keystone_user', {'user_name': 'nova', 'user_password': 'nova'})[0] + # nova_keystone_role = vr.create('nova_keystone_role', 'resources/keystone_role', {'role_name': 'nova'})[0] + + # TODO: 'services' tenant-id is hardcoded + # nova_keystone_service_endpoint = vr.create('nova_keystone_service_endpoint', 'resources/keystone_service_endpoint', {'adminurl': 'http://{{ip}}:{{admin_port}}/v2/services', 'internalurl': 'http://{{ip}}:{{public_port}}/v2/services', 'publicurl': 'http://{{ip}}:{{port}}/v2/services', 'description': 'OpenStack Compute Service', 'type': 'compute', 'port': 8776, 'admin_port': 8776})[0] + # signals.connect(node1, nova_network_puppet) # signals.connect(services_tenant, nova_keystone_user) @@ -147,8 +198,9 @@ def deploy(): # signals.connect(nova_keystone_user, nova_network_puppet, {'user_name': 'keystone_user', 'user_password': 'keystone_password', 'tenant_name': 'keystone_tenant'}) # signals.connect(keystone_puppet, nova_network_puppet, {'ip': 'keystone_host', 'port': 'keystone_port'}) - #signals.connect(nova_network_puppet, nova_keystone_service_endpoint, {'ip': 'ip', 'ssh_key': 'ssh_key', 'ssh_user': 'ssh_user'}) - #signals.connect(keystone_puppet, nova_keystone_service_endpoint, {'ip': 'keystone_host', 'admin_port': 'keystone_port', 'admin_token': 'admin_token'}) + # signals.connect(nova_network_puppet, nova_keystone_service_endpoint, {'ip': 'ip', 'ssh_key': 'ssh_key', 'ssh_user': 'ssh_user'}) + # signals.connect(keystone_puppet, nova_keystone_service_endpoint, {'ip': 'keystone_host', 'admin_port': 'keystone_port', 'admin_token': 'admin_token'}) + # signals.connect(rabbitmq_service1, nova_network_puppet, {'ip': 'rabbitmq_host', 'port': 'rabbitmq_port'}) has_errors = False @@ -190,10 +242,12 @@ def deploy(): actions.resource_action(neutron_puppet, 'run') actions.resource_action(neutron_keystone_service_endpoint, 'run') - # actions.resource_action(cinder_keystone_user, 'run') - # actions.resource_action(cinder_keystone_role, 'run') + actions.resource_action(cinder_db, 'run') + actions.resource_action(cinder_db_user, 'run') + actions.resource_action(cinder_keystone_user, 'run') + actions.resource_action(cinder_keystone_role, 'run') - # actions.resource_action(cinder_puppet, 'run') + actions.resource_action(cinder_puppet, 'run') # actions.resource_action(nova_keystone_user, 'run') # actions.resource_action(nova_keystone_role, 'run') @@ -239,13 +293,13 @@ def undeploy(): # actions.resource_action(resources['nova_keystone_role'], 'remove') # actions.resource_action(resources['nova_keystone_user'], 'remove') - # actions.resource_action(resources['cinder_puppet'], 'remove' ) + actions.resource_action(resources['cinder_puppet'], 'remove' ) # actions.resource_action(resources['neutron_keystone_service_endpoint'], 'remove' ) # actions.resource_action(resources['neutron_puppet'], 'remove' ) - # actions.resource_action(resources['cinder_keystone_role'], 'remove') - # actions.resource_action(resources['cinder_keystone_user'], 'remove') + actions.resource_action(resources['cinder_keystone_role'], 'remove') + actions.resource_action(resources['cinder_keystone_user'], 'remove') # actions.resource_action(resources['neutron_keystone_role'], 'remove') # actions.resource_action(resources['neutron_keystone_user'], 'remove') From d0c98358b15a8cfdfce2d9f5bdce834123ca452a Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Thu, 16 Jul 2015 12:20:49 +0200 Subject: [PATCH 2/5] Comment out cinder WIP Signed-off-by: Bogdan Dobrelya --- example-puppet.py | 84 +++++++++++++++++++++++------------------------ 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/example-puppet.py b/example-puppet.py index 2d6185d2..2b3811cb 100644 --- a/example-puppet.py +++ b/example-puppet.py @@ -49,8 +49,8 @@ def deploy(): signals.connect(node1, rabbitmq_service1) signals.connect(rabbitmq_service1, openstack_vhost) signals.connect(rabbitmq_service1, openstack_rabbitmq_user) - signals.connect(openstack_vhost, openstack_rabbitmq_user, {'vhost_name': 'vhost_name'}) - + signals.connect(openstack_vhost, openstack_rabbitmq_user, {'vhost_name': 'vhost_name'}) + # KEYSTONE keystone_puppet = vr.create('keystone_puppet', 'resources/keystone_puppet', {})[0] keystone_db = vr.create('keystone_db', 'resources/mariadb_keystone_db/', {'db_name': 'keystone_db', 'login_user': 'root'})[0] @@ -122,7 +122,7 @@ def deploy(): signals.connect(keystone_puppet, services_tenant) signals.connect(keystone_puppet, services_tenant, {'admin_port': 'keystone_port', 'ip': 'keystone_host'}) - + signals.connect(keystone_db, keystone_puppet, {'db_name': 'db_name'}) signals.connect(keystone_db_user, keystone_puppet, {'new_user_name': 'db_user', 'new_user_password': 'db_password'}) @@ -146,39 +146,40 @@ def deploy(): signals.connect(neutron_puppet, neutron_keystone_service_endpoint, {'ip': 'public_ip', 'port': 'public_port'}) signals.connect(keystone_puppet, neutron_keystone_service_endpoint, {'ip': 'keystone_host', 'admin_port': 'keystone_admin_port', 'admin_token': 'admin_token'}) - # CINDER - cinder_puppet = vr.create('cinder_puppet', 'resources/cinder_puppet', { - 'rabbit_userid': 'guest', 'rabbit_password': 'guest'})[0] - cinder_db = vr.create('cinder_db', 'resources/mariadb_db/', { - 'db_name': 'cinder_db', 'login_user': 'root'})[0] - cinder_db_user = vr.create('cinder_db_user', 'resources/mariadb_user/', { - 'user_name': 'cinder', 'user_password': 'cinder', 'login_user': 'root'})[0] - cinder_keystone_user = vr.create('cinder_keystone_user', 'resources/keystone_user', { - 'user_name': 'cinder', 'user_password': 'cinder'})[0] - cinder_keystone_role = vr.create('cinder_keystone_role', 'resources/keystone_role', { - 'role_name': 'cinder'})[0] - cinder_keystone_service_endpoint = vr.create( - 'cinder_keystone_service_endpoint', 'resources/keystone_service_endpoint', { - 'adminurl': 'http://{{admin_ip}}:{{admin_port}}', - 'internalurl': 'http://{{internal_ip}}:{{internal_port}}', - 'publicurl': 'http://{{public_ip}}:{{public_port}}', - 'description': 'OpenStack Network Service', 'type': 'network'})[0] + # # CINDER + # cinder_puppet = vr.create('cinder_puppet', 'resources/cinder_puppet', { + # 'rabbit_userid': 'guest', 'rabbit_password': 'guest'})[0] + # cinder_db = vr.create('cinder_db', 'resources/mariadb_db/', { + # 'db_name': 'cinder_db', 'login_user': 'root'})[0] + # cinder_db_user = vr.create('cinder_db_user', 'resources/mariadb_user/', { + # 'user_name': 'cinder', 'user_password': 'cinder', 'login_user': 'root'})[0] + # cinder_keystone_user = vr.create('cinder_keystone_user', 'resources/keystone_user', { + # 'user_name': 'cinder', 'user_password': 'cinder'})[0] + # cinder_keystone_role = vr.create('cinder_keystone_role', 'resources/keystone_role', { + # 'role_name': 'cinder'})[0] + # cinder_keystone_service_endpoint = vr.create( + # 'cinder_keystone_service_endpoint', 'resources/keystone_service_endpoint', { + # 'adminurl': 'http://{{admin_ip}}:{{admin_port}}', + # 'internalurl': 'http://{{internal_ip}}:{{internal_port}}', + # 'publicurl': 'http://{{public_ip}}:{{public_port}}', + # 'description': 'OpenStack Network Service', 'type': 'network'})[0] - signals.connect(node1, cinder_db) - signals.connect(node1, cinder_db_user) - signals.connect(rabbitmq_service1, cinder_puppet, {'ip': 'rabbit_host', 'port': 'rabbit_port'}) - signals.connect(openstack_vhost, cinder_puppet, {'vhost_name': 'rabbit_virtual_host'}) - signals.connect(openstack_rabbitmq_user, cinder_puppet, {'user_name': 'rabbit_userid', 'password': 'rabbit_password'}) - signals.connect(mariadb_service1, cinder_db, { - 'port': 'login_port', 'root_password': 'login_password'}) - signals.connect(mariadb_service1, cinder_db_user, { - 'port': 'login_port', 'root_password': 'login_password'}) - signals.connect(cinder_db, cinder_db_user, {'db_name': 'db_name'}) + # signals.connect(node1, cinder_db) + # signals.connect(node1, cinder_db_user) + # signals.connect(node1, cinder_puppet) + # signals.connect(rabbitmq_service1, cinder_puppet, {'ip': 'rabbit_host', 'port': 'rabbit_port'}) + # signals.connect(openstack_vhost, cinder_puppet, {'vhost_name': 'rabbit_virtual_host'}) + # signals.connect(openstack_rabbitmq_user, cinder_puppet, {'user_name': 'rabbit_userid', 'password': 'rabbit_password'}) + # signals.connect(mariadb_service1, cinder_db, { + # 'port': 'login_port', 'root_password': 'login_password'}) + # signals.connect(mariadb_service1, cinder_db_user, { + # 'port': 'login_port', 'root_password': 'login_password'}) + # signals.connect(cinder_db, cinder_db_user, {'db_name': 'db_name'}) + + # signals.connect(services_tenant, cinder_keystone_user) + # signals.connect(cinder_keystone_user, cinder_keystone_role) - signals.connect(services_tenant, cinder_keystone_user) - signals.connect(cinder_keystone_user, cinder_keystone_role) - # NOVA # #nova_network_puppet = vr.create('nova_network_puppet', GitProvider(GIT_PUPPET_LIBS_URL, 'nova_network'), {'rabbitmq_user': 'guest', 'rabbitmq_password': 'guest'})[0] # # TODO: fix rabbitmq user/password @@ -242,12 +243,12 @@ def deploy(): actions.resource_action(neutron_puppet, 'run') actions.resource_action(neutron_keystone_service_endpoint, 'run') - actions.resource_action(cinder_db, 'run') - actions.resource_action(cinder_db_user, 'run') - actions.resource_action(cinder_keystone_user, 'run') - actions.resource_action(cinder_keystone_role, 'run') + # actions.resource_action(cinder_db, 'run') + # actions.resource_action(cinder_db_user, 'run') + # actions.resource_action(cinder_keystone_user, 'run') + # actions.resource_action(cinder_keystone_role, 'run') - actions.resource_action(cinder_puppet, 'run') + # actions.resource_action(cinder_puppet, 'run') # actions.resource_action(nova_keystone_user, 'run') # actions.resource_action(nova_keystone_role, 'run') @@ -293,13 +294,12 @@ def undeploy(): # actions.resource_action(resources['nova_keystone_role'], 'remove') # actions.resource_action(resources['nova_keystone_user'], 'remove') - actions.resource_action(resources['cinder_puppet'], 'remove' ) - # actions.resource_action(resources['neutron_keystone_service_endpoint'], 'remove' ) # actions.resource_action(resources['neutron_puppet'], 'remove' ) - actions.resource_action(resources['cinder_keystone_role'], 'remove') - actions.resource_action(resources['cinder_keystone_user'], 'remove') + # actions.resource_action(resources['cinder_puppet'], 'remove' ) + # actions.resource_action(resources['cinder_keystone_role'], 'remove') + # actions.resource_action(resources['cinder_keystone_user'], 'remove') # actions.resource_action(resources['neutron_keystone_role'], 'remove') # actions.resource_action(resources['neutron_keystone_user'], 'remove') From bfd4e89e2d9837f1957d24216fdfa3548c6f7dd9 Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Thu, 16 Jul 2015 14:21:22 +0200 Subject: [PATCH 3/5] Rebase on master Signed-off-by: Bogdan Dobrelya --- example-puppet.py | 37 ++----------------------------------- 1 file changed, 2 insertions(+), 35 deletions(-) diff --git a/example-puppet.py b/example-puppet.py index 2b3811cb..9e2219b6 100644 --- a/example-puppet.py +++ b/example-puppet.py @@ -55,51 +55,18 @@ def deploy(): keystone_puppet = vr.create('keystone_puppet', 'resources/keystone_puppet', {})[0] keystone_db = vr.create('keystone_db', 'resources/mariadb_keystone_db/', {'db_name': 'keystone_db', 'login_user': 'root'})[0] keystone_db_user = vr.create('keystone_db_user', 'resources/mariadb_keystone_user/', {'new_user_name': 'keystone', 'new_user_password': 'keystone', 'login_user': 'root'})[0] - - #keystone_puppet = vr.create('keystone_puppet', GitProvider(GIT_PUPPET_LIBS_URL, path='keystone'), {})[0] - keystone_puppet = vr.create('keystone_puppet', 'resources/keystone_puppet', {})[0] - keystone_service_endpoint = vr.create('keystone_service_endpoint', 'resources/keystone_service_endpoint', {'endpoint_name': 'keystone', 'adminurl': 'http://{{admin_ip}}:{{admin_port}}/v2.0', 'internalurl': 'http://{{internal_ip}}:{{internal_port}}/v2.0', 'publicurl': 'http://{{public_ip}}:{{public_port}}/v2.0', 'description': 'OpenStack Identity Service', 'type': 'identity'})[0] - # # TODO: vhost cannot be specified in neutron Puppet manifests so this user has to be admin anyways - # neutron_puppet = vr.create('neutron_puppet', GitProvider(GIT_PUPPET_LIBS_URL, path='neutron'), {'rabbitmq_user': 'guest', 'rabbitmq_password': 'guest'})[0] - neutron_puppet = vr.create('neutron_puppet', 'resources/neutron_puppet', {'rabbitmq_user': 'guest', 'rabbitmq_password': 'guest'})[0] - admin_tenant = vr.create('admin_tenant', 'resources/keystone_tenant', {'tenant_name': 'admin'})[0] admin_user = vr.create('admin_user', 'resources/keystone_user', {'user_name': 'admin', 'user_password': 'admin'})[0] admin_role = vr.create('admin_role', 'resources/keystone_role', {'role_name': 'admin'})[0] services_tenant = vr.create('services_tenant', 'resources/keystone_tenant', {'tenant_name': 'services'})[0] - neutron_keystone_user = vr.create('neutron_keystone_user', 'resources/keystone_user', {'user_name': 'neutron', 'user_password': 'neutron'})[0] - neutron_keystone_role = vr.create('neutron_keystone_role', 'resources/keystone_role', {'role_name': 'neutron'})[0] - - neutron_keystone_service_endpoint = vr.create('neutron_keystone_service_endpoint', 'resources/keystone_service_endpoint', {'endpoint_name': 'neutron', 'adminurl': 'http://{{admin_ip}}:{{admin_port}}', 'internalurl': 'http://{{internal_ip}}:{{internal_port}}', 'publicurl': 'http://{{public_ip}}:{{public_port}}', 'description': 'OpenStack Network Service', 'type': 'network'})[0] - - # #cinder_puppet = vr.create('cinder_puppet', GitProvider(GIT_PUPPET_LIBS_URL, 'cinder'), {})[0] - # cinder_puppet = vr.create('cinder_puppet', 'resources/cinder_puppet', {})[0] - - # cinder_keystone_user = vr.create('cinder_keystone_user', 'resources/keystone_user', {'user_name': 'cinder', 'user_password': 'cinder'})[0] - # cinder_keystone_role = vr.create('cinder_keystone_role', 'resources/keystone_role', {'role_name': 'cinder'})[0] - - # #nova_network_puppet = vr.create('nova_network_puppet', GitProvider(GIT_PUPPET_LIBS_URL, 'nova_network'), {'rabbitmq_user': 'guest', 'rabbitmq_password': 'guest'})[0] - # # TODO: fix rabbitmq user/password - # nova_network_puppet = vr.create('nova_network_puppet', 'resources/nova_network_puppet', {'rabbitmq_user': 'guest', 'rabbitmq_password': 'guest'})[0] - - # nova_keystone_user = vr.create('nova_keystone_user', 'resources/keystone_user', {'user_name': 'nova', 'user_password': 'nova'})[0] - # nova_keystone_role = vr.create('nova_keystone_role', 'resources/keystone_role', {'role_name': 'nova'})[0] - - # TODO: 'services' tenant-id is hardcoded - #nova_keystone_service_endpoint = vr.create('nova_keystone_service_endpoint', 'resources/keystone_service_endpoint', {'adminurl': 'http://{{ip}}:{{admin_port}}/v2/services', 'internalurl': 'http://{{ip}}:{{public_port}}/v2/services', 'publicurl': 'http://{{ip}}:{{port}}/v2/services', 'description': 'OpenStack Compute Service', 'type': 'compute', 'port': 8776, 'admin_port': 8776})[0] - signals.connect(node1, rabbitmq_service1) signals.connect(rabbitmq_service1, openstack_vhost) signals.connect(rabbitmq_service1, openstack_rabbitmq_user) signals.connect(openstack_vhost, openstack_rabbitmq_user, {'vhost_name': 'vhost_name'}) signals.connect(rabbitmq_service1, neutron_puppet, {'ip': 'rabbitmq_host', 'port': 'rabbitmq_port'}) - # signals.connect(openstack_vhost, cinder_puppet, {'vhost_name': 'rabbitmq_vhost'}) - # signals.connect(openstack_rabbitmq_user, cinder_puppet, {'user_name': 'rabbitmq_user', 'password': 'rabbitmq_password'}) - # signals.connect(rabbitmq_service1, cinder_puppet, {'ip': 'rabbitmq_host', 'port': 'rabbitmq_port'}) - # signals.connect(rabbitmq_service1, nova_network_puppet, {'ip': 'rabbitmq_host', 'port': 'rabbitmq_port'}) signals.connect(node1, mariadb_service1) signals.connect(node1, keystone_db) @@ -131,8 +98,8 @@ def deploy(): neutron_puppet = vr.create('neutron_puppet', 'resources/neutron_puppet', {'rabbitmq_user': 'guest', 'rabbitmq_password': 'guest'})[0] neutron_keystone_user = vr.create('neutron_keystone_user', 'resources/keystone_user', {'user_name': 'neutron', 'user_password': 'neutron'})[0] - neutron_keystone_role = vr.create('neutron_keystone_role', 'resources/keystone_role', {'role_name': 'neutron'})[0] - neutron_keystone_service_endpoint = vr.create('neutron_keystone_service_endpoint', 'resources/keystone_service_endpoint', {'adminurl': 'http://{{admin_ip}}:{{admin_port}}', 'internalurl': 'http://{{internal_ip}}:{{internal_port}}', 'publicurl': 'http://{{public_ip}}:{{public_port}}', 'description': 'OpenStack Network Service', 'type': 'network'})[0] + neutron_keystone_role = vr.create('neutron_keystone_role', 'resources/keystone_role', {'role_name': 'neutron'})[0] + neutron_keystone_service_endpoint = vr.create('neutron_keystone_service_endpoint', 'resources/keystone_service_endpoint', {'endpoint_name': 'neutron', 'adminurl': 'http://{{admin_ip}}:{{admin_port}}', 'internalurl': 'http://{{internal_ip}}:{{internal_port}}', 'publicurl': 'http://{{public_ip}}:{{public_port}}', 'description': 'OpenStack Network Service', 'type': 'network'})[0] signals.connect(node1, neutron_puppet) signals.connect(rabbitmq_service1, neutron_puppet, {'ip': 'rabbitmq_host', 'port': 'rabbitmq_port'}) From c3ae824a493bc0ff33127329cb83f5629f1e5d52 Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Thu, 16 Jul 2015 15:01:25 +0200 Subject: [PATCH 4/5] Del duplicating connection Signed-off-by: Bogdan Dobrelya --- example-puppet.py | 1 - 1 file changed, 1 deletion(-) diff --git a/example-puppet.py b/example-puppet.py index 9e2219b6..a6a21bdf 100644 --- a/example-puppet.py +++ b/example-puppet.py @@ -66,7 +66,6 @@ def deploy(): signals.connect(rabbitmq_service1, openstack_vhost) signals.connect(rabbitmq_service1, openstack_rabbitmq_user) signals.connect(openstack_vhost, openstack_rabbitmq_user, {'vhost_name': 'vhost_name'}) - signals.connect(rabbitmq_service1, neutron_puppet, {'ip': 'rabbitmq_host', 'port': 'rabbitmq_port'}) signals.connect(node1, mariadb_service1) signals.connect(node1, keystone_db) From feca572a7fa0a720692daabca26f29880c46ab4b Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Thu, 16 Jul 2015 14:54:50 +0200 Subject: [PATCH 5/5] Fix keystone admin connection Signed-off-by: Bogdan Dobrelya --- example-puppet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example-puppet.py b/example-puppet.py index a6a21bdf..9b50b2f8 100644 --- a/example-puppet.py +++ b/example-puppet.py @@ -106,7 +106,7 @@ def deploy(): signals.connect(keystone_puppet, neutron_puppet, {'ip': 'keystone_host', 'port': 'keystone_port'}) signals.connect(services_tenant, neutron_keystone_user) signals.connect(neutron_keystone_user, neutron_keystone_role) - signals.connect(neutron_puppet, neutron_keystone_service_endpoint, {'ip': 'ip', 'ssh_key': 'ssh_key', 'ssh_user': 'ssh_user'}) + signals.connect(keystone_puppet, neutron_keystone_service_endpoint, {'ip': 'ip', 'ssh_key': 'ssh_key', 'ssh_user': 'ssh_user'}) signals.connect(neutron_puppet, neutron_keystone_service_endpoint, {'ip': 'admin_ip', 'port': 'admin_port'}) signals.connect(neutron_puppet, neutron_keystone_service_endpoint, {'ip': 'internal_ip', 'port': 'internal_port'}) signals.connect(neutron_puppet, neutron_keystone_service_endpoint, {'ip': 'public_ip', 'port': 'public_port'})