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

Override Ceph version #2574

Merged
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
7 changes: 7 additions & 0 deletions roles/cifmw_cephadm/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,10 @@ cifmw_cephadm_update_log_commands:
cmd: "log last cephadm"
cifmw_cephadm_wait_for_dashboard_retries: 10
cifmw_cephadm_wait_for_dashboard_delay: 20
# Repository parameters
cifmw_cephadm_repository_override: false
# we usually support N+1 Ceph version: Adding Squid here because Reef is the
# default version installed in a greenfield scenario
cifmw_cephadm_version: "squid"
# bug in cephadm: if you skip "prepare host" it will fail
cifmw_cephadm_prepare_host: false
2 changes: 2 additions & 0 deletions roles/cifmw_cephadm/tasks/bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@
{% if not cifmw_cephadm_default_container %}--image {{ cifmw_cephadm_container_ns + '/' + cifmw_cephadm_container_image + ':' + cifmw_cephadm_container_tag|string }} \{% endif %}
bootstrap \
--skip-firewalld \
{% if not cifmw_cephadm_prepare_host %}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fultonj looks like from Squid+ we don't need to --skip-prepare-host, as we already have everything in place when we reach this point (network, lvdevices, podman) [1].
I would try a testproject with this change to make sure we don't hit any side effect.

[1] https://github.com/ceph/ceph/blob/squid-release/src/cephadm/cephadm.py#L4494

--skip-prepare-host \
{% endif %}
--ssh-private-key /home/{{ cifmw_cephadm_ssh_user }}/.ssh/id_rsa \
--ssh-public-key /home/{{ cifmw_cephadm_ssh_user }}/.ssh/id_rsa.pub \
--ssh-user {{ cifmw_cephadm_ssh_user }} \
Expand Down
45 changes: 45 additions & 0 deletions roles/cifmw_cephadm/tasks/install_cephadm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
# Copyright 2024 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

- name: Enabled ceph Tools Repository
when:
- cifmw_cephadm_repository_override | bool
become: true
ansible.builtin.dnf:
name: centos-release-ceph-{{ cifmw_cephadm_version }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dlrn embeds the Centos-Storage-Sig repos, and by installing this package we can simply override the Ceph related sections, bumping the version to a newer release.

state: present

- name: Install cephadm package
become: true
when:
- cifmw_cephadm_predeployed | bool or
cifmw_cephadm_repository_override | bool
ansible.builtin.dnf:
name: cephadm
state: present

- name: Stat cephadm file
ansible.builtin.stat:
path: "{{ cifmw_cephadm_bin }}"
register: stat_cephadm
become: true
ignore_errors: true # noqa: ignore-errors

- name: Fail if cephadm is not available
when:
- not stat_cephadm.stat.exists
ansible.builtin.fail:
msg: "{{ cifmw_cephadm_bin }} does not exist"
23 changes: 2 additions & 21 deletions roles/cifmw_cephadm/tasks/pre.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,8 @@
tags:
- always

- name: Install cephadm package # noqa: package-latest
become: true
when:
- cifmw_cephadm_predeployed | bool
ansible.builtin.package:
name: cephadm
state: latest
releasever: "{{ ansible_facts['distribution_major_version'] }}"

- name: Stat cephadm file
ansible.builtin.stat:
path: "{{ cifmw_cephadm_bin }}"
register: stat_cephadm
become: true
ignore_errors: true # noqa: ignore-errors

- name: Fail if cephadm is not available
when:
- not stat_cephadm.stat.exists
ansible.builtin.fail:
msg: "{{ cifmw_cephadm_bin }} does not exist"
- name: Install cephadm package
ansible.builtin.include_tasks: install_cephadm.yml

- name: List Ceph daemon instances on this host
ansible.builtin.command:
Expand Down
7 changes: 7 additions & 0 deletions zuul.d/edpm_multinode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,13 @@
dashboard_enabled: true
cephfs_enabled: true
ceph_nfs_enabled: true
# Override the Ceph container tag and deploy Squid
cifmw_cephadm_container_tag: "v19"
# Override the Ceph Tools repo and install cephadm Squid
cifmw_cephadm_repository_override: true
cifmw_cephadm_version: "squid"
cifmw_cephadm_prepare_host: true

files:
- ^hooks/playbooks/control_plane_ceph_backends.yml
- ^hooks/playbooks/control_plane_hci_pre_deploy.yml
Expand Down