Browse Source

README included

master
Alvaro Uría 3 years ago
parent
commit
b07920df4a
1 changed files with 71 additions and 0 deletions
  1. 71
    0
      README.md

+ 71
- 0
README.md View File

@@ -0,0 +1,71 @@
1
+# keystone-admin interface
2
+
3
+Use this interface to use keystone credentials in your charm layers.
4
+
5
+## Purpose
6
+
7
+By relating you charm layer (keystone-admin:identity-admin) with
8
+keystone service, keystone's API endpoint as well as username, password
9
+and region name will be shared.
10
+
11
+## How to use in your layers
12
+
13
+The event handler for `identity-admin.connected` is called when a relation
14
+is established between your charm layer and keystone.
15
+
16
+In case there are no unset shared data (ie: service_password), a new event
17
+handler will be set: `identity-admin.available`.
18
+
19
+This object provides a method,
20
+
21
+credentials()
22
+
23
+returing 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
+
33
+metadata.yaml
34
+```
35
+requires:
36
+  identity-admin:
37
+    interface: keystone-admin
38
+```
39
+
40
+layer.yaml,
41
+```
42
+includes: ['layer:basic', 'interface:keystone-admin']
43
+```
44
+
45
+charm layer example,
46
+```
47
+@when('identity-admin.available')
48
+def 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
+
69
+where `keystone-creds.yaml` has the necessary configuration settings for your
70
+awesome charm to connect to keystone.
71
+

Loading…
Cancel
Save