Commit 450feaac authored by Sébastien Han's avatar Sébastien Han
Browse files

ceph: implement cluster name support



we now have the ability to enable the `cluster` variable with a specific
value that will determine the name of the cluster.
Signed-off-by: default avatarSébastien Han <seb@redhat.com>
parent 4c31c3bc
......@@ -9,7 +9,7 @@
with_items:
- /var/lib/ceph/bootstrap-rgw
- /var/lib/ceph/radosgw
- /var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}
- /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_hostname }}
- "{{ rbd_client_admin_socket_path }}"
- name: copy rados gateway bootstrap key
......@@ -20,22 +20,22 @@
group: "{{ key_group }}"
mode: "{{ key_mode }}"
with_items:
- { name: /var/lib/ceph/bootstrap-rgw/ceph.keyring, copy_key: true }
- { name: /etc/ceph/ceph.client.admin.keyring, copy_key: "{{ copy_admin_key }}" }
- { name: "/var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring", copy_key: true }
- { name: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" }
when:
cephx and
item.copy_key|bool
- name: create rados gateway keyring
command: ceph --cluster ceph --name client.bootstrap-rgw --keyring /var/lib/ceph/bootstrap-rgw/ceph.keyring auth get-or-create client.rgw.{{ ansible_hostname }} osd 'allow rwx' mon 'allow rw' -o /var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}/keyring
command: ceph --cluster {{ cluster }} --name client.bootstrap-rgw --keyring /var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring auth get-or-create client.rgw.{{ ansible_hostname }} osd 'allow rwx' mon 'allow rw' -o /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_hostname }}/keyring
args:
creates: /var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}/keyring
creates: /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_hostname }}/keyring
changed_when: false
when: cephx
- name: set rados gateway key permissions (for or after the infernalis release)
file:
path: /var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}/keyring
path: /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_hostname }}/keyring
mode: "{{ key_mode }}"
owner: "{{ key_owner }}"
group: "{{ key_group }}"
......@@ -43,7 +43,7 @@
- name: activate rados gateway with upstart
file:
path: /var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}/{{ item }}
path: /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_hostname }}/{{ item }}
state: touch
owner: "{{ activate_file_owner }}"
group: "{{ activate_file_group }}"
......@@ -56,7 +56,7 @@
- name: activate rados gateway with sysvinit
file:
path: /var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}/{{ item }}
path: /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_hostname }}/{{ item }}
state: touch
owner: "{{ activate_file_owner }}"
group: "{{ activate_file_group }}"
......
......@@ -12,16 +12,10 @@
ansible_distribution != "Ubuntu" and
ansible_os_family != 'RedHat'
- name: activate rgw on ubuntu
command: initctl emit radosgw cluster=ceph id=rgw.{{ ansible_hostname }}
- name: start and add that the rados gateway service to the init sequence (ubuntu)
command: initctl emit radosgw cluster={{ cluster }} id=rgw.{{ ansible_hostname }}
changed_when: false
when: ansible_distribution == 'Ubuntu'
- name: start rgw on ubuntu
service:
name: radosgw
args: id=rgw.{{ ansible_hostname }}
state: started
failed_when: false
when: ansible_distribution == 'Ubuntu'
- name: start rgw on red hat (before or on infernalis)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment