diff --git a/README.md b/README.md new file mode 100644 index 00000000..a9911d07 --- /dev/null +++ b/README.md @@ -0,0 +1,68 @@ +Overview +======== + +The OpenStack Dashboard provides a Django based web interface for use by both +administrators and users of an OpenStack Cloud. + +It allows you to managed Nova, Glance, Cinder and Neutron resources within the +cloud. + +Usage +===== + +The OpenStack Dashboard is deployed and related to keystone: + + juju deploy openstack-dashboard + juju add-unit openstack-dashboard keystone + +The dashboard will use keystone for user authentication and authorization and +to interact with the catalog of services within the cloud. + +The dashboard is accessible on: + + http(s)://service_unit_address/horizon + +At a minimum, the cloud must provide Glance and Nova services. + +SSL configuration +================= + +To fully secure your dashboard services, you can provide a SSL key and +certificate for installation and configuration. These are provided as +base64 encoded configuration options:: + + juju set openstack-dashboard ssl_key="$(base64 my.key)" \ + ssl_cert="$(base64 my.cert)" + +The service will be reconfigured to use the supplied information. + +High Availability +================= + +The OpenStack Dashboard charm supports HA in-conjunction with the hacluster +charm: + + juju deploy hacluster dashboard-hacluster + juju set openstack-dashboard vip="192.168.1.200" + juju add-relation openstack-dashboard dashboard-hacluster + juju add-unit -n 2 openstack-dashboard + +After addition of the extra 2 units completes, the dashboard will be +accessible on 192.168.1.200 with full load-balancing across all three units. + +Please refer to the charm configuration for full details on all HA config +options. + + +Use with a Load Balancing Proxy +=============================== + +Instead of deploying with the hacluster charm for load balancing, its possible +to also deploy the dashboard with load balancing proxy such as HAProxy: + + juju deploy haproxy + juju add-relation haproxy openstack-dashboard + juju add-unit -n 2 openstack-dashboard + +This option potentially provides better scale-out than using the charm in +conjunction with the hacluster charm. diff --git a/hooks/horizon_relations.py b/hooks/horizon_relations.py index c73d698f..31df0158 100755 --- a/hooks/horizon_relations.py +++ b/hooks/horizon_relations.py @@ -8,7 +8,8 @@ from charmhelpers.core.hookenv import ( config, relation_set, relation_get, - relation_ids + relation_ids, + unit_get ) from charmhelpers.core.host import ( apt_update, apt_install, @@ -17,7 +18,8 @@ from charmhelpers.core.host import ( ) from charmhelpers.contrib.openstack.utils import ( configure_installation_source, - openstack_upgrade_available + openstack_upgrade_available, + save_script_rc ) from horizon_utils import ( PACKAGES, register_configs, @@ -57,6 +59,17 @@ def config_changed(): enable_ssl() if openstack_upgrade_available('openstack-dashboard'): do_openstack_upgrade(configs=CONFIGS) + + env_vars = { + 'OPENSTACK_URL_HORIZON': + "http://localhost:70{}|Login+-+OpenStack".format( + config('webroot') + ), + 'OPENSTACK_SERVICE_HORIZON': "apache2", + 'OPENSTACK_PORT_HORIZON_SSL': 433, + 'OPENSTACK_PORT_HORIZON': 70 + } + save_script_rc(**env_vars) CONFIGS.write_all() @@ -112,6 +125,13 @@ def ha_relation_joined(): resource_params=resource_params, clones=clones) + +@hooks.hook('website-relation-joined') +def website_relation_joined(): + relation_set(port=70, + hostname=unit_get('private-address')) + + if __name__ == '__main__': try: hooks.execute(sys.argv) diff --git a/hooks/horizon_utils.py b/hooks/horizon_utils.py index 50d4b080..c1d15645 100644 --- a/hooks/horizon_utils.py +++ b/hooks/horizon_utils.py @@ -127,6 +127,5 @@ def do_openstack_upgrade(configs): apt_update() apt_install(packages=PACKAGES, options=dpkg_opts, fatal=True) - # set CONFIGS to load templates from new release and regenerate config + # set CONFIGS to load templates from new release configs.set_release(openstack_release=new_os_rel) - configs.write_all() diff --git a/hooks/shared-db-relation-changed b/hooks/start similarity index 100% rename from hooks/shared-db-relation-changed rename to hooks/start diff --git a/hooks/shared-db-relation-joined b/hooks/stop similarity index 100% rename from hooks/shared-db-relation-joined rename to hooks/stop diff --git a/hooks/website-relation-joined b/hooks/website-relation-joined new file mode 120000 index 00000000..8355ca46 --- /dev/null +++ b/hooks/website-relation-joined @@ -0,0 +1 @@ +horizon_relations.py \ No newline at end of file diff --git a/metadata.yaml b/metadata.yaml index ec27a7bd..3a1a3dd1 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -2,11 +2,13 @@ name: openstack-dashboard summary: a Django web interface to OpenStack maintainer: Adam Gandelman description: | - + The OpenStack Dashboard provides a full feature web interface for interacting + with instances, images, volumes and networks within an OpenStack deployment. categories: ["misc"] +provides: + website: + interface: http requires: - shared-db: - interface: mysql identity-service: interface: keystone ha: