diff --git a/example-puppet.py b/example-puppet.py index 72d4f431..7f344aad 100644 --- a/example-puppet.py +++ b/example-puppet.py @@ -154,17 +154,14 @@ def deploy(): # 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_puppet = vr.create('neutron_puppet', 'resources/neutron_puppet', {})[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' + 'role_name': 'admin' })[0] neutron_keystone_service_endpoint = vr.create('neutron_keystone_service_endpoint', 'resources/keystone_service_endpoint', { 'endpoint_name': 'neutron', @@ -180,6 +177,11 @@ def deploy(): 'ip': 'rabbitmq_host', 'port': 'rabbitmq_port' }) + signals.connect(openstack_rabbitmq_user, neutron_puppet, { + 'user_name': 'rabbitmq_user', + 'password': 'rabbitmq_password'}) + signals.connect(openstack_vhost, neutron_puppet, { + 'vhost_name': 'rabbitmq_virtual_host'}) signals.connect(admin_user, neutron_puppet, { 'user_name': 'keystone_user', 'user_password': 'keystone_password', diff --git a/resources/neutron_puppet/actions/run.pp b/resources/neutron_puppet/actions/run.pp index c57f3af8..299636bc 100644 --- a/resources/neutron_puppet/actions/run.pp +++ b/resources/neutron_puppet/actions/run.pp @@ -1,4 +1,4 @@ -$resource = hiera('{{ resource_name }}') +$resource = hiera($::resource_name) $ip = $resource['input']['ip']['value'] @@ -6,6 +6,7 @@ $rabbitmq_user = $resource['input']['rabbitmq_user']['value'] $rabbitmq_password = $resource['input']['rabbitmq_password']['value'] $rabbitmq_host = $resource['input']['rabbitmq_host']['value'] $rabbitmq_port = $resource['input']['rabbitmq_port']['value'] +$rabbitmq_virtual_host = $resource['input']['rabbitmq_virtual_host']['value'] $keystone_host = $resource['input']['keystone_host']['value'] $keystone_port = $resource['input']['keystone_port']['value'] @@ -23,6 +24,7 @@ class { 'neutron': rabbit_password => $rabbitmq_password, rabbit_host => $rabbitmq_host, rabbit_port => $rabbitmq_port, + rabbit_virtual_host => $rabbitmq_virtual_host, service_plugins => ['metering'] } diff --git a/resources/neutron_puppet/meta.yaml b/resources/neutron_puppet/meta.yaml index a6bc77a5..ca43ceb0 100644 --- a/resources/neutron_puppet/meta.yaml +++ b/resources/neutron_puppet/meta.yaml @@ -24,6 +24,9 @@ input: rabbitmq_password: schema: str! value: '' + rabbitmq_virtual_host: + schema: str! + value: '' git: schema: {repository: str!, branch: str!}