Merge "CI: cephadm: Add osds/pools/users in one run"

This commit is contained in:
Zuul 2022-06-20 16:35:27 +00:00 committed by Gerrit Code Review
commit 8f3b61cedd
3 changed files with 31 additions and 38 deletions

View File

@ -65,44 +65,19 @@
dest: "/var/run/ceph/{{ ceph_fsid }}/cluster.yml" dest: "/var/run/ceph/{{ ceph_fsid }}/cluster.yml"
become: True become: True
- name: Check Ceph Orchestrator state - name: Template out command spec
command: template:
cmd: > src: templates/commands.sh.j2
cephadm shell -- dest: "/var/run/ceph/{{ ceph_fsid }}/commands.sh"
ceph orch status --detail
become: True become: True
- name: Apply cluster spec - name: Run commands
command: command:
cmd: > cmd: >
cephadm shell -- cephadm shell --
ceph orch apply -i /var/run/ceph/cluster.yml bash /var/run/ceph/commands.sh
become: True become: True
- name: Add osds
command:
cmd: >
cephadm shell --
ceph orch daemon add osd {{ item }}
become: True
loop: "{{ cephadm_ceph_osd_devices }}"
- name: Create and initialise pools for OpenStack services
command:
cmd: >
cephadm shell --
ceph osd pool create {{ item }}
with_items: "{{ cephadm_ceph_pools }}"
become: true
- name: Create users for OpenStack services
command:
cmd: >
cephadm shell --
ceph auth get-or-create {{ item }}
become: true
with_items: "{{ cephadm_ceph_users }}"
# TODO(mnasiadka): Fix merge_configs to support tabs # TODO(mnasiadka): Fix merge_configs to support tabs
- name: Generate ceph.conf without tabs - name: Generate ceph.conf without tabs
vars: vars:
@ -112,10 +87,5 @@
mon_host = {% for host in groups['all'] %} {{ hostvars[host]['ansible_'+api_interface_name].ipv4.address }} {% if not loop.last %},{% endif %} {% endfor %} mon_host = {% for host in groups['all'] %} {{ hostvars[host]['ansible_'+api_interface_name].ipv4.address }} {% if not loop.last %},{% endif %} {% endfor %}
copy: copy:
content: "{{ ceph_conf_fixed }}" content: "{{ ceph_conf_fixed }}"
dest: /etc/ceph/ceph.conf dest: "/etc/ceph/ceph.conf.fixed"
become: True
- name: Check ceph health
command:
cmd: cephadm shell -- ceph health detail
become: True become: True

View File

@ -0,0 +1,23 @@
# Status
ceph orch status --detail
# Apply cluster spec
ceph orch apply -i /var/run/ceph/cluster.yml
# OSDs
{% for osd in cephadm_ceph_osd_devices %}
ceph orch daemon add osd {{ osd }}
{% endfor %}
# Pools
{% for pool in cephadm_ceph_pools %}
ceph osd pool create {{ pool }}
{% endfor %}
# Users
{% for user in cephadm_ceph_users %}
ceph auth get-or-create {{ user }}
{% endfor %}
# Health
ceph health detail

View File

@ -361,7 +361,7 @@
- name: copy ceph.conf to enabled services - name: copy ceph.conf to enabled services
copy: copy:
remote_src: True remote_src: True
src: "/etc/ceph/ceph.conf" src: "/etc/ceph/ceph.conf.fixed"
dest: "/etc/kolla/config/{{ item.name }}/ceph.conf" dest: "/etc/kolla/config/{{ item.name }}/ceph.conf"
with_items: "{{ cephadm_kolla_ceph_services }}" with_items: "{{ cephadm_kolla_ceph_services }}"