2015-01-30 23:16:18 +08:00
|
|
|
---
|
|
|
|
# Wait for mon discovery and quorum resolution
|
|
|
|
# the admin key is not instantanely created so we have to wait a bit
|
|
|
|
|
|
|
|
- name: wait for client.admin key exists
|
|
|
|
wait_for: path=/etc/ceph/ceph.client.admin.keyring
|
|
|
|
|
|
|
|
- name: Create RGW keyring
|
2015-03-19 19:21:29 +08:00
|
|
|
command: >
|
2015-03-23 19:20:00 +08:00
|
|
|
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
|
2015-01-30 23:16:18 +08:00
|
|
|
when: cephx and radosgw
|
2015-02-22 08:16:00 +08:00
|
|
|
with_items: groups.rgws
|
2015-01-30 23:16:18 +08:00
|
|
|
changed_when: False
|
|
|
|
|
2015-03-23 22:08:58 +08:00
|
|
|
- name: Create Ceph REST API keyring
|
|
|
|
command: >
|
|
|
|
ceph auth get-or-create client.restapi osd 'allow *' mon 'allow *' -o /etc/ceph/ceph.client.restapi.keyring
|
|
|
|
creates=/etc/ceph/ceph.client.restapi.keyring
|
|
|
|
when: cephx and restapi
|
|
|
|
changed_when: False
|
|
|
|
|
2015-01-30 23:16:18 +08:00
|
|
|
- include: openstack_config.yml
|
|
|
|
when: openstack_config and cephx
|
|
|
|
|
|
|
|
- name: Find Ceph keys
|
|
|
|
shell: ls -1 /etc/ceph/*.keyring
|
|
|
|
register: ceph_keys
|
|
|
|
when: cephx
|
2015-04-09 00:46:54 +08:00
|
|
|
changed_when: False
|
2015-01-30 23:16:18 +08:00
|
|
|
|
2015-03-23 22:08:58 +08:00
|
|
|
- name: Set keys permissions
|
|
|
|
file: >
|
|
|
|
path={{ item }}
|
|
|
|
mode=0600
|
|
|
|
owner=root
|
|
|
|
group=root
|
|
|
|
with_items:
|
|
|
|
- "{{ ceph_keys.stdout_lines }}"
|
|
|
|
|
2015-01-30 23:16:18 +08:00
|
|
|
- name: Copy keys to the ansible server
|
|
|
|
fetch: >
|
|
|
|
src={{ item }}
|
|
|
|
dest=fetch/{{ fsid }}/{{ item }}
|
|
|
|
flat=yes
|
|
|
|
when: cephx
|
|
|
|
with_items:
|
|
|
|
- "{{ ceph_keys.stdout_lines }}"
|
|
|
|
- /var/lib/ceph/bootstrap-osd/ceph.keyring
|
|
|
|
- /var/lib/ceph/bootstrap-mds/ceph.keyring
|
|
|
|
|
|
|
|
- name: Drop in a motd script to report status when logging in
|
|
|
|
copy: >
|
|
|
|
src=precise/92-ceph
|
|
|
|
dest=/etc/update-motd.d/92-ceph
|
|
|
|
owner=root
|
|
|
|
group=root
|
|
|
|
mode=0755
|
|
|
|
when: ansible_distribution_release == 'precise'
|