docker: ability to change ceph config directory

Signed-off-by: Sébastien Han <seb@redhat.com>
pull/1624/head
Sébastien Han 2017-06-23 16:05:35 +02:00
parent 7bb04a5970
commit 0c21fb3f66
8 changed files with 24 additions and 19 deletions

View File

@ -418,7 +418,9 @@ dummy:
# These values have to be set according to the base OS used by the container image, NOT the host.
#bootstrap_dirs_owner: "64045"
#bootstrap_dirs_group: "64045"
#
#ceph_conf_key_directory: /etc/ceph
############
# KV store #
############

View File

@ -13,7 +13,9 @@ mon_use_fqdn: false # if set to true, the MON name used will be the fqdn
# These values have to be set according to the base OS used by the container image, NOT the host.
bootstrap_dirs_owner: "64045"
bootstrap_dirs_group: "64045"
#
ceph_conf_key_directory: /etc/ceph
############
# KV store #
############

View File

@ -2,10 +2,10 @@
- name: set config and keys paths
set_fact:
ceph_config_keys:
- /etc/ceph/{{ cluster }}.client.admin.keyring
- /etc/ceph/{{ cluster }}.conf
- /etc/ceph/monmap-{{ cluster }}
- /etc/ceph/{{ cluster }}.mon.keyring
- "{{ ceph_conf_key_directory }}/{{ cluster }}.client.admin.keyring"
- "{{ ceph_conf_key_directory }}/{{ cluster }}.conf"
- "{{ ceph_conf_key_directory }}/monmap-{{ cluster }}"
- "{{ ceph_conf_key_directory }}/{{ cluster }}.mon.keyring"
- /var/lib/ceph/bootstrap-osd/{{ cluster }}.keyring
- /var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring
- /var/lib/ceph/bootstrap-mds/{{ cluster }}.keyring

View File

@ -26,7 +26,7 @@
action: config_template
args:
src: "{{ playbook_dir }}/roles/ceph-common/templates/ceph.conf.j2"
dest: "/etc/ceph/{{ cluster }}.conf"
dest: "{{ ceph_conf_key_directory }}/{{ cluster }}.conf"
owner: "root"
group: "root"
mode: "0644"

View File

@ -7,7 +7,7 @@
group: "{{ bootstrap_dirs_group }}"
mode: "0755"
with_items:
- /etc/ceph/
- "{{ ceph_conf_key_directory }}"
- /var/lib/ceph/bootstrap-osd
- /var/lib/ceph/bootstrap-mds
- /var/lib/ceph/bootstrap-rgw

View File

@ -2,17 +2,17 @@
- name: set config and keys paths
set_fact:
ceph_config_keys:
- /etc/ceph/{{ cluster }}.conf
- /etc/ceph/{{ cluster }}.client.admin.keyring
- /etc/ceph/monmap-{{ cluster }}
- /etc/ceph/{{ cluster }}.mon.keyring
- "{{ ceph_conf_key_directory }}/{{ cluster }}.conf"
- "{{ ceph_conf_key_directory }}/{{ cluster }}.client.admin.keyring"
- "{{ ceph_conf_key_directory }}/monmap-{{ cluster }}"
- "{{ ceph_conf_key_directory }}/{{ cluster }}.mon.keyring"
- /var/lib/ceph/bootstrap-osd/{{ cluster }}.keyring
- /var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring
- /var/lib/ceph/bootstrap-mds/{{ cluster }}.keyring
- name: add mgr keys to config and keys paths
set_fact:
tmp_ceph_mgr_keys: /etc/ceph/{{ cluster }}.mgr.{{ hostvars[item]['ansible_hostname'] }}.keyring
tmp_ceph_mgr_keys: "{{ ceph_conf_key_directory }}/{{ cluster }}.mgr.{{ hostvars[item]['ansible_hostname'] }}.keyring"
with_items: "{{ groups.get(mgr_group_name, []) }}"
register: tmp_ceph_mgr_keys_result
when: "{{ groups.get(mgr_group_name, []) | length > 0 }}"

View File

@ -6,9 +6,10 @@
always_run: true
- name: set selinux permissions
shell: chcon -Rt svirt_sandbox_file_t {{ item }}
shell: |
chcon -Rt svirt_sandbox_file_t {{ item }}
with_items:
- /etc/ceph
- "{{ ceph_conf_key_directory }}"
- /var/lib/ceph
changed_when: false
when: sestatus.stdout != 'Disabled'

View File

@ -27,7 +27,7 @@
- name: create ceph rest api keyring when mon is containerized
command: docker exec ceph-mon-{{ ansible_hostname }} ceph --cluster {{ cluster }} auth get-or-create client.restapi osd 'allow *' mon 'allow *' -o /etc/ceph/{{ cluster }}.client.restapi.keyring
args:
creates: /etc/ceph/{{ cluster }}.client.restapi.keyring
creates: "{{ ceph_conf_key_directory }}/{{ cluster }}.client.restapi.keyring"
changed_when: false
when:
- cephx
@ -48,7 +48,7 @@
- name: create ceph mgr keyring(s) when mon is containerized
command: docker exec ceph-mon-{{ ansible_hostname }} ceph --cluster {{ cluster }} auth get-or-create mgr.{{ hostvars[item]['ansible_hostname'] }} mon 'allow profile mgr' osd 'allow *' mds 'allow *' -o /etc/ceph/{{ cluster }}.mgr.{{ hostvars[item]['ansible_hostname'] }}.keyring
args:
creates: /etc/ceph/{{ cluster }}.mgr.{{ hostvars[item]['ansible_hostname'] }}.keyring
creates: "{{ ceph_conf_key_directory }}/{{ cluster }}.mgr.{{ hostvars[item]['ansible_hostname'] }}.keyring"
changed_when: false
when:
- cephx
@ -59,7 +59,7 @@
- name: stat for ceph mgr key(s)
stat:
path: /etc/ceph/{{ cluster }}.mgr.{{ hostvars[item]['ansible_hostname'] }}.keyring
path: "{{ ceph_conf_key_directory }}/{{ cluster }}.mgr.{{ hostvars[item]['ansible_hostname'] }}.keyring"
with_items: "{{ groups.get(mgr_group_name, []) }}"
changed_when: false
become: false
@ -71,7 +71,7 @@
- name: push ceph mgr key(s)
fetch:
src: "/etc/ceph/{{ cluster }}.mgr.{{ hostvars[item.item]['ansible_hostname'] }}.keyring"
src: "{{ ceph_conf_key_directory }}/{{ cluster }}.mgr.{{ hostvars[item.item]['ansible_hostname'] }}.keyring"
dest: "{{ fetch_directory }}/docker_mon_files/{{ item.stat.path }}"
flat: yes
with_items: