]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Bring multi RGW support 210/head
authorSébastien Han <sebastien.han@enovance.com>
Sun, 22 Feb 2015 00:16:00 +0000 (01:16 +0100)
committerSébastien Han <sebastien.han@enovance.com>
Sun, 22 Feb 2015 00:23:03 +0000 (01:23 +0100)
Now we can setup multi-rgw with the playbook.
Each rgw instance has its own key.

Signed-off-by: Sébastien Han <sebastien.han@enovance.com>
roles/ceph-common/templates/ceph.conf.j2
roles/ceph-mon/tasks/ceph_keys.yml
roles/ceph-radosgw/tasks/main.yml

index 91424d65de2e7a742ee3b27d2ee3500178850687..88f09a1c922cf8541ad40eec0b57028b9f996187 100644 (file)
 {% if radosgw %}
 {% for host in groups['rgws'] %}
 {% if hostvars[host]['ansible_hostname'] is defined %}
-[client.radosgw.gateway]
+[client.radosgw.{{ hostvars[host]['ansible_hostname'] }}]
   {% if radosgw_dns_name is defined %}
     rgw dns name = {{ radosgw_dns_name }}
   {% endif %}
   host = {{ hostvars[host]['ansible_hostname'] }}
-  keyring = /etc/ceph/radosgw.gateway.keyring
+  keyring = /etc/ceph/radosgw.{{ hostvars[host]['ansible_hostname'] }}.keyring
   rgw socket path = /tmp/radosgw-{{ hostvars[host]['ansible_hostname'] }}.sock
   log file = /var/log/ceph/radosgw-{{ hostvars[host]['ansible_hostname'] }}.log
   rgw data = /var/lib/ceph/radosgw/{{ hostvars[host]['ansible_hostname'] }}
index 060f1aa759fd5ef0176abcc8ead320050d3cbb23..fda56a5292f91022b3c2b8a2319a6924cb290d8b 100644 (file)
@@ -6,8 +6,9 @@
   wait_for: path=/etc/ceph/ceph.client.admin.keyring
 
 - name: Create RGW keyring
-  command: ceph auth get-or-create client.radosgw.gateway osd 'allow rwx' mon 'allow rw' -o /etc/ceph/radosgw.gateway.keyring creates=/etc/ceph/radosgw.gateway.keyring
+  command: ceph auth get-or-create client.radosgw.{{ hostvars[item]['ansible_hostname'] }} osd 'allow rwx' mon 'allow rw' -o /etc/ceph/radosgw.{{ hostvars[item]['ansible_hostname'] }}.keyring creates=/etc/ceph/radosgw.{{ hostvars[item]['ansible_hostname'] }}.keyring
   when: cephx and radosgw
+  with_items: groups.rgws
   changed_when: False
 
 - include: openstack_config.yml
index ecfd0c610b3f53b1e1293585dd05ceb8435847ba..bea2a8278008018976ae2ab2663d6c2a7b21faf2 100644 (file)
@@ -1,10 +1,19 @@
 ---
 - name: Copy RGW bootstrap key
-  copy: src=fetch/{{ fsid }}/etc/ceph/radosgw.gateway.keyring dest=/etc/ceph/radosgw.gateway.keyring owner=root group=root mode=600
+  copy: >
+    src=fetch/{{ fsid }}/etc/ceph/radosgw.{{ ansible_hostname }}.keyring
+    dest=/etc/ceph/radosgw.{{ ansible_hostname }}.keyring
+    owner=root
+    group=root
+    mode=600
   when: cephx
 
 - name: Set RGW bootstrap key permissions
-  file: path=/etc/ceph/radosgw.gateway.keyring mode=0600 owner=root group=root
+  file: >
+    path=/etc/ceph/radosgw.{{ ansible_hostname }}.keyring
+    mode=0600
+    owner=root
+    group=root
   when: cephx
 
 ## Check OS family