]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Allow deployer to customize openstack pools 984/head
authorPaulo Matias <matias@ufscar.br>
Wed, 21 Sep 2016 12:21:41 +0000 (09:21 -0300)
committerPaulo Matias <matias@ufscar.br>
Wed, 21 Sep 2016 17:49:42 +0000 (14:49 -0300)
By overriding the openstack_pools variable introduced by this commit, the
deployer may choose not to create some of the openstack pools, or to add
new pools which were not foreseen by ceph-ansible, e.g. for a gnocchi
storage backend.

For backwards compatibility, we keep the openstack_glance_pool,
openstack_cinder_pool, openstack_nova_pool and
openstack_cinder_backup_pool variables, although the user may now choose
to specify the pools directly as dictionary literals inside the
openstack_pools list.

group_vars/mons.sample
roles/ceph-mon/defaults/main.yml
roles/ceph-mon/tasks/openstack_config.yml

index 6897349909808835beda62da5b394a8f211bfdc8..e4ea4d434fb8f9ad715b6605af3b1749368773c2 100644 (file)
@@ -61,6 +61,12 @@ dummy:
 #  name: backups
 #  pg_num: "{{ pool_default_pg_num }}"
 
+#openstack_pools:
+#  - "{{ openstack_glance_pool }}"
+#  - "{{ openstack_cinder_pool }}"
+#  - "{{ openstack_nova_pool }}"
+#  - "{{ openstack_cinder_backup_pool }}"
+
 #openstack_keys:
 #  - { name: client.glance, value: "mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool={{ openstack_glance_pool.name }}'" }
 #  - { name: client.cinder, value: "mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool={{ openstack_cinder_pool.name }}, allow rwx pool={{ openstack_nova_pool.name }}, allow rx pool={{ openstack_glance_pool.name }}'"  }
index 8a7f20ad2595eb850e28350d6d30232de58d5a3d..0737ef3ea4137afcf72741e97f02e5cdf086685e 100644 (file)
@@ -53,6 +53,12 @@ openstack_cinder_backup_pool:
   name: backups
   pg_num: "{{ pool_default_pg_num }}"
 
+openstack_pools:
+  - "{{ openstack_glance_pool }}"
+  - "{{ openstack_cinder_pool }}"
+  - "{{ openstack_nova_pool }}"
+  - "{{ openstack_cinder_backup_pool }}"
+
 openstack_keys:
   - { name: client.glance, value: "mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool={{ openstack_glance_pool.name }}'" }
   - { name: client.cinder, value: "mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool={{ openstack_cinder_pool.name }}, allow rwx pool={{ openstack_nova_pool.name }}, allow rx pool={{ openstack_glance_pool.name }}'"  }
index d0d39ca5295347910c8bc235197a3cee88b5f30b..02b21272e9451cefd4d132f1f9cd37aadd1f9d0f 100644 (file)
@@ -1,11 +1,7 @@
 ---
 - name: create openstack pool
   command: ceph --cluster {{ cluster }} osd pool create {{ item.name }} {{ item.pg_num }}
-  with_items:
-    - "{{ openstack_glance_pool }}"
-    - "{{ openstack_cinder_pool }}"
-    - "{{ openstack_nova_pool }}"
-    - "{{ openstack_cinder_backup_pool }}"
+  with_items: "{{ openstack_pools }}"
   changed_when: false
   failed_when: false
 
@@ -13,6 +9,6 @@
   command: ceph --cluster {{ cluster }} auth get-or-create {{ item.name }} {{ item.value }} -o /etc/ceph/{{ cluster }}.{{ item.name }}.keyring
   args:
     creates: /etc/ceph/{{ cluster }}.{{ item.name }}.keyring
-  with_items: openstack_keys
+  with_items: "{{ openstack_keys }}"
   changed_when: false
   when: cephx