2015-01-30 23:16:18 +08:00
|
|
|
---
|
2015-05-16 00:27:41 +08:00
|
|
|
# NOTE (leseb): wait for mon discovery and quorum resolution
|
2015-01-30 23:16:18 +08:00
|
|
|
# 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
|
|
|
|
|
2015-07-24 02:01:43 +08:00
|
|
|
- name: create ceph rest api keyring
|
2015-03-23 22:08:58 +08:00
|
|
|
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
|
2015-06-26 06:26:03 +08:00
|
|
|
changed_when: false
|
|
|
|
when:
|
|
|
|
cephx and
|
2015-07-02 17:08:59 +08:00
|
|
|
groups[restapi_group_name] is defined
|
2015-03-23 22:08:58 +08:00
|
|
|
|
2015-01-30 23:16:18 +08:00
|
|
|
- include: openstack_config.yml
|
2015-06-26 06:26:03 +08:00
|
|
|
when:
|
|
|
|
openstack_config and
|
|
|
|
cephx
|
2015-01-30 23:16:18 +08:00
|
|
|
|
2015-07-24 02:01:43 +08:00
|
|
|
- name: find ceph keys
|
2015-01-30 23:16:18 +08:00
|
|
|
shell: ls -1 /etc/ceph/*.keyring
|
2015-06-26 06:26:03 +08:00
|
|
|
changed_when: false
|
2015-01-30 23:16:18 +08:00
|
|
|
register: ceph_keys
|
|
|
|
when: cephx
|
|
|
|
|
2015-05-16 00:27:41 +08:00
|
|
|
- name: set keys permissions
|
2015-03-23 22:08:58 +08:00
|
|
|
file: >
|
|
|
|
path={{ item }}
|
|
|
|
mode=0600
|
|
|
|
owner=root
|
|
|
|
group=root
|
|
|
|
with_items:
|
|
|
|
- "{{ ceph_keys.stdout_lines }}"
|
|
|
|
|
2015-05-16 00:27:41 +08:00
|
|
|
- name: copy keys to the ansible server
|
2015-01-30 23:16:18 +08:00
|
|
|
fetch: >
|
|
|
|
src={{ item }}
|
|
|
|
dest=fetch/{{ fsid }}/{{ item }}
|
|
|
|
flat=yes
|
|
|
|
with_items:
|
|
|
|
- "{{ ceph_keys.stdout_lines }}"
|
|
|
|
- /var/lib/ceph/bootstrap-osd/ceph.keyring
|
2015-06-12 17:47:08 +08:00
|
|
|
- /var/lib/ceph/bootstrap-rgw/ceph.keyring
|
2015-01-30 23:16:18 +08:00
|
|
|
- /var/lib/ceph/bootstrap-mds/ceph.keyring
|
2015-06-26 06:26:03 +08:00
|
|
|
when: cephx
|
2015-01-30 23:16:18 +08:00
|
|
|
|
2015-05-16 00:27:41 +08:00
|
|
|
- name: drop in a motd script to report status when logging in
|
2015-01-30 23:16:18 +08:00
|
|
|
copy: >
|
|
|
|
src=precise/92-ceph
|
|
|
|
dest=/etc/update-motd.d/92-ceph
|
|
|
|
owner=root
|
|
|
|
group=root
|
|
|
|
mode=0755
|
|
|
|
when: ansible_distribution_release == 'precise'
|