]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Rework radosgw keys and data dir path 231/head
authorSébastien Han <sebastien.han@enovance.com>
Mon, 23 Mar 2015 11:20:00 +0000 (12:20 +0100)
committerSébastien Han <sebastien.han@enovance.com>
Mon, 23 Mar 2015 13:41:22 +0000 (14:41 +0100)
Fix the usage of Upstart for Ubuntu machines instead of the init.d
script.
Note that because of the way upstart init script looks at the radosgw id
the command 'start radosgw id=' is broken, you should use 'start
radosgw-all' instead.
Keep backard compatibility with the radosgw init script as well by using
client prefixed by 'client.radosgw'.

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/pre_requisite.yml
roles/ceph-radosgw/tasks/start_radosgw.yml

index 47c3818d2d8325382bded35c0d02ba74f81657a0..a0416525a53d54a54c1399e0bb4d5e9cf0b81302 100644 (file)
     rgw dns name = {{ radosgw_dns_name }}
   {% endif %}
   host = {{ hostvars[host]['ansible_hostname'] }}
-  keyring = /etc/ceph/radosgw.{{ hostvars[host]['ansible_hostname'] }}.keyring
+  keyring = /var/lib/ceph/radosgw/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'] }}
+  rgw data = /var/lib/ceph/radosgw/ceph-radosgw.{{ hostvars[host]['ansible_hostname'] }}
   rgw print continue = false
   {% if radosgw_frontend  == 'civetweb' %}
   rgw frontends = civetweb port={{ radosgw_civetweb_port }}
index 73761a2c2881af20a4cee4b3f5ae81dc9d2c2b57..798dae83d6b8d64b2014b4b2edc8fc4d4e7d9093 100644 (file)
@@ -7,8 +7,8 @@
 
 - name: Create RGW 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
+    ceph auth get-or-create client.radosgw.{{ hostvars[item]['ansible_hostname'] }} osd 'allow rwx' mon 'allow rw' -o /etc/ceph/ceph.client.radosgw.{{ hostvars[item]['ansible_hostname'] }}.keyring
+    creates=/etc/ceph/ceph.client.radosgw.{{ hostvars[item]['ansible_hostname'] }}.keyring
   when: cephx and radosgw
   with_items: groups.rgws
   changed_when: False
index 4e64153234661a90ce1b75d78c074d7971de2a15..80fabf82c1077c44174dbc56f5f7816d9135c883 100644 (file)
@@ -1,25 +1,25 @@
 ---
-- name: Copy RGW bootstrap key
-  copy: >
-    src=fetch/{{ fsid }}/etc/ceph/radosgw.{{ ansible_hostname }}.keyring
-    dest=/etc/ceph/radosgw.{{ ansible_hostname }}.keyring
+- name: Create RGW directory
+  file: >
+    path=/var/lib/ceph/radosgw/ceph-radosgw.{{ ansible_fqdn }}
+    state=directory
     owner=root
     group=root
-    mode=600
-  when: cephx
+    mode=0644
 
-- name: Set RGW bootstrap key permissions
-  file: >
-    path=/etc/ceph/radosgw.{{ ansible_hostname }}.keyring
-    mode=0600
+- name: Copy RGW bootstrap key
+  copy: >
+    src=fetch/{{ fsid }}/etc/ceph/ceph.client.radosgw.{{ ansible_hostname }}.keyring
+    dest=/var/lib/ceph/radosgw/ceph-radosgw.{{ ansible_hostname }}/keyring
     owner=root
     group=root
+    mode=600
   when: cephx
 
-- name: Create RGW directory
+- name: Activate RGW with upstart
   file: >
-    path=/var/lib/ceph/radosgw/{{ ansible_fqdn }}
-    state=directory
+    path=/var/lib/ceph/radosgw/ceph-radosgw.{{ ansible_fqdn }}/done
+    state=touch
     owner=root
     group=root
     mode=0644
index 574b40862e8e17199dd1d8a20cd7273374bfe4aa..0db1a1d05fcccdda8df0cfccf99053b3f410cdfd 100644 (file)
@@ -4,7 +4,12 @@
   command: /etc/init.d/radosgw status
   register: rgwstatus
   ignore_errors: True
+  when: ansible_distribution != "Ubuntu"
+
+- name: Start RGW
+  service: name=radosgw-all state=started
+  when: ansible_distribution == "Ubuntu"
 
 - name: Start RGW
   command: /etc/init.d/radosgw start
-  when: rgwstatus.rc != 0
+  when: rgwstatus.rc != 0 and ansible_distribution != "Ubuntu"