summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlvaro Uría <alvaro.uria@canonical.com>2016-03-16 11:19:20 +0100
committerAlvaro Uría <alvaro.uria@canonical.com>2016-03-16 11:19:20 +0100
commitb07920df4a8da51d963106621d6ce3888ab530d7 (patch)
tree99fab647e944f2ede19ba848d25b2335e1b0554c
parent89a95ef70bdb685cc3d80c039a40e839d518086e (diff)
README included
-rw-r--r--README.md71
1 files changed, 71 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..3fc68cc
--- /dev/null
+++ b/README.md
@@ -0,0 +1,71 @@
1# keystone-admin interface
2
3Use this interface to use keystone credentials in your charm layers.
4
5## Purpose
6
7By relating you charm layer (keystone-admin:identity-admin) with
8keystone service, keystone's API endpoint as well as username, password
9and region name will be shared.
10
11## How to use in your layers
12
13The event handler for `identity-admin.connected` is called when a relation
14is established between your charm layer and keystone.
15
16In case there are no unset shared data (ie: service_password), a new event
17handler will be set: `identity-admin.available`.
18
19This object provides a method,
20
21credentials()
22
23returing a dict of:
24
25 {u'service_password': u'XXXXXXXX',
26 u'service_port': u'5000',
27 u'service_hostname': u'10.XX.XX.XXX',
28 u'service_username': u'admin',
29 u'service_tenant_name': u'Admin',
30 u'service_region': u'RegionOne'}
31
32
33metadata.yaml
34```
35requires:
36 identity-admin:
37 interface: keystone-admin
38```
39
40layer.yaml,
41```
42includes: ['layer:basic', 'interface:keystone-admin']
43```
44
45charm layer example,
46```
47@when('identity-admin.available')
48def setup_openstack_plugin(kst_data):
49 creds = kst_data.credentials()
50 if data_changed('identity-admin.config', creds):
51 settings = {'keystone_vip': creds['service_hostname'],
52 'keystone_port': creds['service_port'],
53 'username': creds['service_username'],
54 'password': creds['service_password'],
55 'tenant_name': creds['service_tenant_name'],
56 }
57```
58
59## Example deployment
60
61```
62$ juju deploy your-awesome-charm
63$ juju deploy keystone --config keystone-creds.yaml
64$ juju deploy mysql
65$ juju add-relation keystone mysql
66$ juju add-relation your-awesome-charm keystone
67```
68
69where `keystone-creds.yaml` has the necessary configuration settings for your
70awesome charm to connect to keystone.
71