diff --git a/example-puppet.py b/example-puppet.py index ada6fa58..4b22e188 100644 --- a/example-puppet.py +++ b/example-puppet.py @@ -363,7 +363,10 @@ def deploy(): # NOVA COMPUTE # Deploy chain (nova, node_networking(TODO)) -> (nova_compute_libvirt, nova_neutron) -> nova_compute nova_compute_puppet = vr.create('nova_compute_puppet', 'resources/nova_compute_puppet', {})[0] - nova_puppet2 = vr.create('nova_puppet2', 'resources/nova_puppet', {})[0] + # TODO (bogdando) figure out how to use it for multiple glance api servers + nova_puppet2 = vr.create('nova_puppet2', 'resources/nova_puppet', { + 'glance_api_servers': '{{glance_api_servers_host}}:{{glance_api_servers_port}}' + })[0] signals.connect(nova_puppet, nova_puppet2, { 'ensure_package', 'rabbit_host', 'rabbit_password', 'rabbit_port', 'rabbit_userid', @@ -454,6 +457,12 @@ def deploy(): 'pipeline': 'keystone', }) + # Update glance_api_service for nova compute + signals.connect(glance_api_puppet, nova_puppet2, { + 'ip': 'glance_api_servers_host', + 'bind_port': 'glance_api_servers_port' + }) + has_errors = False for r in locals().values(): if not isinstance(r, resource.Resource): diff --git a/resources/nova_puppet/actions/run.pp b/resources/nova_puppet/actions/run.pp index f7005d75..81a59824 100644 --- a/resources/nova_puppet/actions/run.pp +++ b/resources/nova_puppet/actions/run.pp @@ -4,6 +4,8 @@ $db_user = $resource['input']['db_user']['value'] $db_password = $resource['input']['db_password']['value'] $db_name = $resource['input']['db_name']['value'] $db_host = $resource['input']['db_host']['value'] +$glance_api_servers_host = $resource['input']['glance_api_servers_host']['value'] +$glance_api_servers_port = $resource['input']['glance_api_servers_port']['value'] $ensure_package = $resource['input']['ensure_package']['value'] $database_connection = $resource['input']['database_connection']['value'] @@ -76,7 +78,7 @@ class { 'nova': database_idle_timeout => $database_idle_timeout, rpc_backend => $rpc_backend, image_service => $image_service, - glance_api_servers => $glance_api_servers, + glance_api_servers => "${glance_api_servers_host}:${glance_api_servers_port}", memcached_servers => $memcached_servers, rabbit_host => $rabbit_host, rabbit_hosts => $rabbit_hosts, diff --git a/resources/nova_puppet/meta.yaml b/resources/nova_puppet/meta.yaml index 8eb1165c..37f26709 100644 --- a/resources/nova_puppet/meta.yaml +++ b/resources/nova_puppet/meta.yaml @@ -222,6 +222,13 @@ input: schema: str! value: + glance_api_servers_port: + schema: int + value: 9292 + glance_api_servers_host: + schema: 'str' + value: 'localhost' + port: schema: int! value: 8774