diff --git a/ansible/inventory/all-in-one b/ansible/inventory/all-in-one index 16d04f6798794305338f65fcff2b52e44a666a36..e031c9bf7bdde4b78081b7dc4b99af56ab219166 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 9dd45d6bc74c1ae5a4c4383fe0169ad335e375c1..7d124f21d8f8a2137d497b4c1a5d16e6fb0d6635 100644 --- a/ansible/inventory/multinode +++ b/ansible/inventory/multinode @@ -308,6 +308,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 e1f4ad1f529be9c68af695a96b781fd460d4d1c6..6bf205e31bf238d2d5e6c2a7cea39b4c8fef2665 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 3c776562a31031e1bfe0b091be6954462b988671..91e7b67e19873654e9a03d12fcd62d9d11cf22de 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 2a5b2e4ed420f416b7d5a4f36dc5bdbd329ed1b4..960d221178bd8fcf4dd697f9a3f53e311096cba6 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 fde080f96717492ddb6ee3a306d374a232883244..2834f2408a2a23378c58f268e63c0deb2a4c0410 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 0000000000000000000000000000000000000000..13ed47a6b17a5104e2905b5b0cb17b398ab9aaf6 --- /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 0000000000000000000000000000000000000000..e741fa8ba6d8f315d8c58978527826a816065044 --- /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 0000000000000000000000000000000000000000..fde2b860921b5ba237edb37f904c6a8db6610b98 --- /dev/null +++ b/releasenotes/notes/implement-ceph-mgr-d631d12ee30df5c8.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + Implement ceph-mgr service