mirror of https://github.com/ceph/ceph-ansible.git
Rework radosgw keys and data dir path
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>pull/231/head
parent
f206d8ee55
commit
4f68598779
|
@ -141,10 +141,10 @@
|
||||||
rgw dns name = {{ radosgw_dns_name }}
|
rgw dns name = {{ radosgw_dns_name }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
host = {{ hostvars[host]['ansible_hostname'] }}
|
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
|
rgw socket path = /tmp/radosgw-{{ hostvars[host]['ansible_hostname'] }}.sock
|
||||||
log file = /var/log/ceph/radosgw-{{ hostvars[host]['ansible_hostname'] }}.log
|
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
|
rgw print continue = false
|
||||||
{% if radosgw_frontend == 'civetweb' %}
|
{% if radosgw_frontend == 'civetweb' %}
|
||||||
rgw frontends = civetweb port={{ radosgw_civetweb_port }}
|
rgw frontends = civetweb port={{ radosgw_civetweb_port }}
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
|
|
||||||
- name: Create RGW keyring
|
- name: Create RGW keyring
|
||||||
command: >
|
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
|
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/radosgw.{{ hostvars[item]['ansible_hostname'] }}.keyring
|
creates=/etc/ceph/ceph.client.radosgw.{{ hostvars[item]['ansible_hostname'] }}.keyring
|
||||||
when: cephx and radosgw
|
when: cephx and radosgw
|
||||||
with_items: groups.rgws
|
with_items: groups.rgws
|
||||||
changed_when: False
|
changed_when: False
|
||||||
|
|
|
@ -1,25 +1,25 @@
|
||||||
---
|
---
|
||||||
|
- name: Create RGW directory
|
||||||
|
file: >
|
||||||
|
path=/var/lib/ceph/radosgw/ceph-radosgw.{{ ansible_fqdn }}
|
||||||
|
state=directory
|
||||||
|
owner=root
|
||||||
|
group=root
|
||||||
|
mode=0644
|
||||||
|
|
||||||
- name: Copy RGW bootstrap key
|
- name: Copy RGW bootstrap key
|
||||||
copy: >
|
copy: >
|
||||||
src=fetch/{{ fsid }}/etc/ceph/radosgw.{{ ansible_hostname }}.keyring
|
src=fetch/{{ fsid }}/etc/ceph/ceph.client.radosgw.{{ ansible_hostname }}.keyring
|
||||||
dest=/etc/ceph/radosgw.{{ ansible_hostname }}.keyring
|
dest=/var/lib/ceph/radosgw/ceph-radosgw.{{ ansible_hostname }}/keyring
|
||||||
owner=root
|
owner=root
|
||||||
group=root
|
group=root
|
||||||
mode=600
|
mode=600
|
||||||
when: cephx
|
when: cephx
|
||||||
|
|
||||||
- name: Set RGW bootstrap key permissions
|
- name: Activate RGW with upstart
|
||||||
file: >
|
file: >
|
||||||
path=/etc/ceph/radosgw.{{ ansible_hostname }}.keyring
|
path=/var/lib/ceph/radosgw/ceph-radosgw.{{ ansible_fqdn }}/done
|
||||||
mode=0600
|
state=touch
|
||||||
owner=root
|
|
||||||
group=root
|
|
||||||
when: cephx
|
|
||||||
|
|
||||||
- name: Create RGW directory
|
|
||||||
file: >
|
|
||||||
path=/var/lib/ceph/radosgw/{{ ansible_fqdn }}
|
|
||||||
state=directory
|
|
||||||
owner=root
|
owner=root
|
||||||
group=root
|
group=root
|
||||||
mode=0644
|
mode=0644
|
||||||
|
|
|
@ -4,7 +4,12 @@
|
||||||
command: /etc/init.d/radosgw status
|
command: /etc/init.d/radosgw status
|
||||||
register: rgwstatus
|
register: rgwstatus
|
||||||
ignore_errors: True
|
ignore_errors: True
|
||||||
|
when: ansible_distribution != "Ubuntu"
|
||||||
|
|
||||||
|
- name: Start RGW
|
||||||
|
service: name=radosgw-all state=started
|
||||||
|
when: ansible_distribution == "Ubuntu"
|
||||||
|
|
||||||
- name: Start RGW
|
- name: Start RGW
|
||||||
command: /etc/init.d/radosgw start
|
command: /etc/init.d/radosgw start
|
||||||
when: rgwstatus.rc != 0
|
when: rgwstatus.rc != 0 and ansible_distribution != "Ubuntu"
|
||||||
|
|
Loading…
Reference in New Issue