diff --git a/ansible/inventory/all-in-one b/ansible/inventory/all-in-one index c78a4f9d82..9de68432f8 100644 --- a/ansible/inventory/all-in-one +++ b/ansible/inventory/all-in-one @@ -290,6 +290,9 @@ neutron neutron # Ceph +[ceph-mgr:children] +ceph + [ceph-mon:children] ceph diff --git a/ansible/inventory/multinode b/ansible/inventory/multinode index 78961ce764..0bdf0ff1bd 100644 --- a/ansible/inventory/multinode +++ b/ansible/inventory/multinode @@ -309,6 +309,9 @@ neutron neutron # Ceph +[ceph-mgr:children] +ceph + [ceph-mon:children] ceph diff --git a/ansible/roles/ceph/defaults/main.yml b/ansible/roles/ceph/defaults/main.yml index e1f4ad1f52..6bf205e31b 100644 --- a/ansible/roles/ceph/defaults/main.yml +++ b/ansible/roles/ceph/defaults/main.yml @@ -12,6 +12,10 @@ ceph_mon_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker ceph_mon_tag: "{{ ceph_tag }}" ceph_mon_image_full: "{{ ceph_mon_image }}:{{ ceph_mon_tag }}" +ceph_mgr_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ ceph_install_type }}-ceph-mgr" +ceph_mgr_tag: "{{ ceph_tag }}" +ceph_mgr_image_full: "{{ ceph_mgr_image }}:{{ ceph_mgr_tag }}" + ceph_osd_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ ceph_install_type }}-ceph-osd" ceph_osd_tag: "{{ ceph_tag }}" ceph_osd_image_full: "{{ ceph_osd_image }}:{{ ceph_osd_tag }}" diff --git a/ansible/roles/ceph/tasks/config.yml b/ansible/roles/ceph/tasks/config.yml index 3c776562a3..91e7b67e19 100644 --- a/ansible/roles/ceph/tasks/config.yml +++ b/ansible/roles/ceph/tasks/config.yml @@ -8,6 +8,7 @@ - "ceph-mon" - "ceph-osd" - "ceph-rgw" + - "ceph-mgr" - name: Copying over config.json files for services template: @@ -22,6 +23,8 @@ group: ceph-osd - name: "ceph-rgw" group: ceph-rgw + - name: "ceph-mgr" + group: "ceph-mgr" - name: Copying over ceph.conf vars: @@ -36,3 +39,4 @@ - "ceph-mon" - "ceph-osd" - "ceph-rgw" + - "ceph-mgr" diff --git a/ansible/roles/ceph/tasks/deploy.yml b/ansible/roles/ceph/tasks/deploy.yml index 2a5b2e4ed4..960d221178 100644 --- a/ansible/roles/ceph/tasks/deploy.yml +++ b/ansible/roles/ceph/tasks/deploy.yml @@ -9,6 +9,9 @@ - include: start_mons.yml when: inventory_hostname in groups['ceph-mon'] +- include: start_mgrs.yml + when: inventory_hostname in groups['ceph-mgr'] + - include: bootstrap_osds.yml when: inventory_hostname in groups['ceph-osd'] diff --git a/ansible/roles/ceph/tasks/pull.yml b/ansible/roles/ceph/tasks/pull.yml index fde080f967..2834f2408a 100644 --- a/ansible/roles/ceph/tasks/pull.yml +++ b/ansible/roles/ceph/tasks/pull.yml @@ -19,3 +19,11 @@ common_options: "{{ docker_common_options }}" image: "{{ ceph_rgw_image_full }}" when: inventory_hostname in groups['ceph-rgw'] + +- name: Pulling ceph-mgr image + kolla_docker: + action: "pull_image" + common_options: "{{ docker_common_options }}" + image: "{{ ceph_mgr_image_full }}" + when: + - inventory_hostname in groups['ceph-mgr'] diff --git a/ansible/roles/ceph/tasks/start_mgrs.yml b/ansible/roles/ceph/tasks/start_mgrs.yml new file mode 100644 index 0000000000..13ed47a6b1 --- /dev/null +++ b/ansible/roles/ceph/tasks/start_mgrs.yml @@ -0,0 +1,27 @@ +--- +- name: Getting ceph mgr keyring + command: docker exec ceph_mon ceph auth get-or-create mgr.{{ inventory_hostname }} mon 'allow profile mgr' osd 'allow *' mds 'allow *' + register: ceph_mgr_keyring + run_once: true + delegate_to: "{{ groups['ceph-mon'][0] }}" + changed_when: false + with_items: "{{ groups['ceph-mgr'] }}" + +- name: Pushing ceph mgr keyring to ceph-mgr + copy: + content: "{{ item.stdout }}\n" + dest: "{{ node_config_directory }}/ceph-mgr/ceph.mgr.{{ inventory_hostname }}.keyring" + when: + - inventory_hostname == item.item + with_items: "{{ ceph_mgr_keyring.results }}" + +- name: Starting ceph-mgr container + kolla_docker: + action: "start_container" + common_options: "{{ docker_common_options }}" + image: "{{ ceph_mgr_image_full }}" + name: "ceph_mgr" + volumes: + - "{{ node_config_directory }}/ceph-mgr/:{{ container_config_directory }}/:ro" + - "/etc/localtime:/etc/localtime:ro" + - "kolla_logs:/var/log/kolla" diff --git a/ansible/roles/ceph/templates/ceph-mgr.json.j2 b/ansible/roles/ceph/templates/ceph-mgr.json.j2 new file mode 100644 index 0000000000..e741fa8ba6 --- /dev/null +++ b/ansible/roles/ceph/templates/ceph-mgr.json.j2 @@ -0,0 +1,17 @@ +{ + "command": "/usr/bin/ceph-mgr -f -i {{ inventory_hostname }}", + "config_files": [ + { + "source": "{{ container_config_directory }}/ceph.conf", + "dest": "/etc/ceph/ceph.conf", + "owner": "ceph", + "perm": "0600" + }, + { + "source": "{{ container_config_directory }}/ceph.mgr.{{ inventory_hostname }}.keyring", + "dest": "/var/lib/ceph/mgr/ceph-{{ inventory_hostname }}/keyring", + "owner": "ceph", + "perm": "0600" + } + ] +} diff --git a/releasenotes/notes/implement-ceph-mgr-d631d12ee30df5c8.yaml b/releasenotes/notes/implement-ceph-mgr-d631d12ee30df5c8.yaml new file mode 100644 index 0000000000..fde2b86092 --- /dev/null +++ b/releasenotes/notes/implement-ceph-mgr-d631d12ee30df5c8.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + Implement ceph-mgr service