]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Ability to populate OpenStack installation 198/head
authorSébastien Han <sebastien.han@enovance.com>
Fri, 30 Jan 2015 12:34:35 +0000 (13:34 +0100)
committerSébastien Han <sebastien.han@enovance.com>
Fri, 30 Jan 2015 12:34:35 +0000 (13:34 +0100)
Creates pools, keys and users.

Signed-off-by: Sébastien Han <sebastien.han@enovance.com>
roles/ceph-mon/defaults/main.yml
roles/ceph-mon/tasks/main.yml
roles/ceph-mon/tasks/openstack_config.yml [new file with mode: 0644]

index c0c2c1132523640e0d9c2948bfdeb7130da13d99..c263221505e10d1ae10578a0fab695eb68b740b8 100644 (file)
@@ -9,3 +9,18 @@ cephx: true
 # Rados Gateway options\r
 # referenced in common role too.\r
 radosgw: false\r
+\r
+###########\r
+# OPENSTACK\r
+###########\r
+\r
+openstack_config: false\r
+openstack_glance_pool: images\r
+openstack_cinder_pool: volumes\r
+openstack_nova_pool: vms\r
+openstack_cinder_backup_pool: backups\r
+\r
+openstack_keys:\r
+  - { name: client.glance, value: "mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool={{ openstack_glance_pool }}'" }\r
+  - { name: client.cinder, value: "mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool={{ openstack_cinder_pool }}, allow rwx pool={{ openstack_nova_pool }}, allow rx pool={{ openstack_glance_pool }}'"  }\r
+  - { name: client.cinder-backup, value: "mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool={{ openstack_cinder_backup_pool }}'" }\r
index 00424e4eaa3f01cb508a6e36b597ffabcf06487c..5dfe84c78c3ea8ebef9daef79c823eaacfa359b0 100644 (file)
@@ -12,6 +12,9 @@
   when: cephx and radosgw
   changed_when: False
 
+- include: openstack_config.yml
+  when: openstack_config
+
 - name: Copy keys to the ansible server
   fetch: >
     src={{ item }}
diff --git a/roles/ceph-mon/tasks/openstack_config.yml b/roles/ceph-mon/tasks/openstack_config.yml
new file mode 100644 (file)
index 0000000..cc6e4b2
--- /dev/null
@@ -0,0 +1,13 @@
+---
+
+- name: Create OpenStack pool
+  command: rados mkpool {{ item }}
+  with_items:
+    - "{{ openstack_glance_pool }}"
+    - "{{ openstack_cinder_pool }}"
+    - "{{ openstack_nova_pool }}"
+    - "{{ openstack_cinder_backup_pool }}"
+
+- name: Create OpenStack keys
+  command: ceph auth get-or-create {{ item.name }} {{ item.value }} -o /etc/ceph/ceph.client.{{ item.name }}.keyring creates=/etc/ceph/ceph.client.{{ item.name }}.keyring
+  with_items: openstack_keys