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
|
2015-10-17 07:55:31 +08:00
|
|
|
wait_for:
|
|
|
|
path: /etc/ceph/ceph.client.admin.keyring
|
2015-01-30 23:16:18 +08:00
|
|
|
|
2016-01-22 03:54:41 +08:00
|
|
|
- name: create ceph rest api keyring when mon is not containerized
|
2015-10-17 07:55:31 +08:00
|
|
|
command: ceph auth get-or-create client.restapi osd 'allow *' mon 'allow *' -o /etc/ceph/ceph.client.restapi.keyring
|
|
|
|
args:
|
|
|
|
creates: /etc/ceph/ceph.client.restapi.keyring
|
2015-06-26 06:26:03 +08:00
|
|
|
changed_when: false
|
|
|
|
when:
|
|
|
|
cephx and
|
2016-01-22 03:54:41 +08:00
|
|
|
not mon_containerized_deployment and
|
|
|
|
groups[restapi_group_name] is defined
|
|
|
|
|
|
|
|
- name: create ceph rest api keyring when mon is containerized
|
|
|
|
command: docker exec {{ ansible_hostname }} ceph auth get-or-create client.restapi osd 'allow *' mon 'allow *' -o /etc/ceph/ceph.client.restapi.keyring
|
|
|
|
args:
|
|
|
|
creates: /etc/ceph/ceph.client.restapi.keyring
|
|
|
|
changed_when: false
|
|
|
|
when:
|
|
|
|
cephx and
|
|
|
|
mon_containerized_deployment and
|
2016-02-09 01:23:37 +08:00
|
|
|
groups[restapi_group_name] is defined and
|
|
|
|
inventory_hostname == groups.mons|last
|
|
|
|
|
2015-03-23 22:08:58 +08:00
|
|
|
|
2015-01-30 23:16:18 +08:00
|
|
|
- include: openstack_config.yml
|
2016-02-27 05:39:27 +08:00
|
|
|
when: openstack_config
|
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-10-17 07:55:31 +08:00
|
|
|
file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
mode: 0600
|
|
|
|
owner: root
|
|
|
|
group: root
|
2015-03-23 22:08:58 +08:00
|
|
|
with_items:
|
|
|
|
- "{{ ceph_keys.stdout_lines }}"
|
2016-02-24 01:33:03 +08:00
|
|
|
when: cephx
|
2015-03-23 22:08:58 +08:00
|
|
|
|
2015-05-16 00:27:41 +08:00
|
|
|
- name: copy keys to the ansible server
|
2015-10-17 07:55:31 +08:00
|
|
|
fetch:
|
|
|
|
src: "{{ item }}"
|
|
|
|
dest: "{{ fetch_directory }}/{{ fsid }}/{{ item }}"
|
|
|
|
flat: yes
|
2015-12-04 23:31:17 +08:00
|
|
|
run_once: true
|
2015-01-30 23:16:18 +08:00
|
|
|
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-10-17 07:55:31 +08:00
|
|
|
copy:
|
|
|
|
src: precise/92-ceph
|
|
|
|
dest: /etc/update-motd.d/92-ceph
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0755
|
2015-01-30 23:16:18 +08:00
|
|
|
when: ansible_distribution_release == 'precise'
|