Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[18.0-fr1] Run ceph update if part of the deployment #2499

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions playbooks/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,42 @@
dest: "/etc/yum.repos.d/"
src: "{{ cifmw_basedir }}/artifacts/repositories/"

- name: Run Ceph update if part of the deployment
hosts: "{{ (groups[cifmw_ceph_target | default('computes')] | default([]))[:1] }}"
gather_facts: true
tasks:
- name: Update Ceph
when: cifmw_ceph_update | default(false) | bool
tags:
- update
- ceph_update
block:
- name: Get ceph.conf to inspect
become: true
ansible.builtin.slurp:
src: "{{ cifmw_ceph_conf }}"
vars:
cifmw_ceph_conf: "/etc/ceph/ceph.conf"
register: cephconf

- name: Save /ceph.conf and inspect content
become: true
delegate_to: localhost
ansible.builtin.copy:
content: "{{ cephconf['content'] | b64decode }}"
dest: "/tmp/ceph.conf"

- name: Extract the CephFSID from ceph.conf
ansible.builtin.set_fact:
ceph_fsid: "{{ lookup('ansible.builtin.ini', 'fsid', section='global', file='/tmp/ceph.conf') }}"

- name: Perform a Ceph Update
ansible.builtin.import_role:
name: cifmw_cephadm
tasks_from: ceph_upgrade
vars:
cifmw_cephadm_fsid: "{{ ceph_fsid }}"

- name: Run update role
hosts: "{{ cifmw_target_host | default('localhost') }}"
gather_facts: false
Expand Down
3 changes: 3 additions & 0 deletions roles/cifmw_ceph_spec/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ cifmw_ceph_spec_private_network: ''

# Enable over-the-wire and on-disk encryption
cifmw_ceph_spec_encryption: false

# osd pool default size is 1 because of single node HCI jobs
cifmw_cephadm_single_host_defaults: true
2 changes: 2 additions & 0 deletions roles/cifmw_ceph_spec/templates/initial_ceph.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ ms_mon_client_mode = secure
ms_mon_cluster_mode = secure
ms_mon_service_mode = secure
{% endif %}
{% if cifmw_cephadm_single_host_defaults %}
osd pool default size = 1
{% endif %}
{% if cifmw_ceph_spec_public_network %}
public_network = {{ cifmw_ceph_spec_public_network }}
{% endif %}
Expand Down
6 changes: 3 additions & 3 deletions roles/cifmw_cephadm/tasks/ceph_upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@

- name: Fail if health is HEALTH_WARN || HEALTH_ERR
ansible.builtin.fail:
msg: Ceph is in {{ ceph_health.status }} state.
msg: Ceph is in {{ ceph_health.health.status }} state.
when:
- ceph_health.status == 'HEALTH_WARN' or
ceph_health.status == 'HEALTH_ERR'
- ceph_health.health.status == 'HEALTH_WARN' or
ceph_health.health.status == 'HEALTH_ERR'

- name: Build container image target
ansible.builtin.set_fact:
Expand Down