Skip to content

Commit

Permalink
Merge branch 'main' into fix/replace_hardcoded_groupname_w_groupname_var
Browse files Browse the repository at this point in the history
  • Loading branch information
gael-api authored Sep 9, 2024
2 parents 76d6654 + e4ab45d commit 06fdc3a
Show file tree
Hide file tree
Showing 19 changed files with 58 additions and 69 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
stale:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
steps:
- uses: actions/stale@v3
with:
Expand Down
7 changes: 7 additions & 0 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ pull_request_rules:
conditions:
- label=backport-stable-7.0
name: backport stable-7.0
- actions:
backport:
branches:
- stable-8.0
conditions:
- label=backport-stable-8.0
name: backport stable-8.0
commands_restrictions:
backport:
conditions:
Expand Down
4 changes: 2 additions & 2 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ The ``main`` branch should be considered experimental and used with caution.

- ``stable-6.0`` Supports Ceph version ``pacific``. This branch requires Ansible version ``2.10``.

- ``stable-7.0`` Supports Ceph version ``quincy``. This branch requires Ansible version ``2.12``.
- ``stable-7.0`` Supports Ceph version ``quincy``. This branch requires Ansible version ``2.15``.

- ``main`` Supports the main (devel) branch of Ceph. This branch requires Ansible version ``2.12``.
- ``main`` Supports the main (devel) branch of Ceph. This branch requires Ansible version ``2.15`` or ``2.16``.

.. NOTE:: ``stable-3.0`` and ``stable-3.1`` branches of ceph-ansible are deprecated and no longer maintained.

Expand Down
2 changes: 1 addition & 1 deletion group_vars/all.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ dummy:
#
#ceph_mirror: https://download.ceph.com
#ceph_stable_key: https://download.ceph.com/keys/release.asc
#ceph_stable_release: reef
#ceph_stable_release: squid
#ceph_stable_repo: "{{ ceph_mirror }}/debian-{{ ceph_stable_release }}"

#nfs_ganesha_stable: true # use stable repos for nfs-ganesha
Expand Down
47 changes: 8 additions & 39 deletions infrastructure-playbooks/rolling_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,37 +131,8 @@

- name: Check ceph release being deployed
ansible.builtin.fail:
msg: "This version of ceph-ansible is intended for upgrading to Ceph Reef only."
when: "'reef' not in ceph_version.stdout.split()"


- name: Ensure cluster config is applied
hosts: mons[0]
become: true
gather_facts: false
any_errors_fatal: true
tasks:
- name: Import default role
ansible.builtin.import_role:
name: ceph-defaults

- name: Import ceph-facts role
ansible.builtin.import_role:
name: ceph-facts
tasks_from: container_binary.yml

- name: Set cluster configs
ceph_config:
action: set
who: "{{ item.0.key }}"
option: "{{ item.1.key }}"
value: "{{ item.1.value }}"
when: item.1.value != omit
loop: "{{ ceph_cluster_conf | dict2dict }}"
environment:
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
CEPH_CONTAINER_BINARY: "{{ container_binary }}"

msg: "This version of ceph-ansible is intended for upgrading to Ceph Squid only."
when: "'squid' not in ceph_version.stdout.split()"

- name: Upgrade ceph mon cluster
tags: mons
Expand Down Expand Up @@ -1183,19 +1154,17 @@
ansible.builtin.meta: end_play
when: not containerized_deployment | bool

- name: Stop the ceph-exporter service # noqa: ignore-errors
- name: Stop the ceph-exporter service
ansible.builtin.systemd:
name: "{{ 'ceph-exporter@' + ansible_facts['hostname'] if containerized_deployment | bool else 'ceph-exporter.service' }}"
state: stopped
ignore_errors: true

# it needs to be done in a separate task otherwise the stop just before doesn't work.
- name: Mask and disable the ceph-exporter service # noqa: ignore-errors
- name: Mask and disable the ceph-exporter service
ansible.builtin.systemd:
name: "{{ 'ceph-exporter@' + ansible_facts['hostname'] if containerized_deployment | bool else 'ceph-exporter.service' }}"
enabled: false
masked: true
ignore_errors: true

- name: Import ceph-defaults role
ansible.builtin.import_role:
Expand Down Expand Up @@ -1226,17 +1195,17 @@
name: ceph-facts
tasks_from: container_binary.yml

- name: Container | disallow pre-reef OSDs and enable all new reef-only functionality
ansible.builtin.command: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_facts']['hostname'] }} ceph --cluster {{ cluster }} osd require-osd-release reef"
- name: Container | disallow pre-squid OSDs and enable all new squid-only functionality
ansible.builtin.command: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_facts']['hostname'] }} ceph --cluster {{ cluster }} osd require-osd-release squid"
delegate_to: "{{ groups[mon_group_name][0] }}"
run_once: true
changed_when: false
when:
- containerized_deployment | bool
- groups.get(mon_group_name, []) | length > 0

- name: Non container | disallow pre-reef OSDs and enable all new reef-only functionality
ansible.builtin.command: "ceph --cluster {{ cluster }} osd require-osd-release reef"
- name: Non container | disallow pre-squid OSDs and enable all new squid-only functionality
ansible.builtin.command: "ceph --cluster {{ cluster }} osd require-osd-release squid"
delegate_to: "{{ groups[mon_group_name][0] }}"
run_once: true
changed_when: false
Expand Down
5 changes: 5 additions & 0 deletions roles/ceph-container-common/tasks/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,8 @@
ansible.builtin.set_fact:
ceph_release: reef
when: ceph_version.split('.')[0] is version('18', '==')

- name: Set_fact ceph_release squid
ansible.builtin.set_fact:
ceph_release: squid
when: ceph_version.split('.')[0] is version('19', '==')
2 changes: 1 addition & 1 deletion roles/ceph-defaults/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ valid_ceph_repository:
#
ceph_mirror: https://download.ceph.com
ceph_stable_key: https://download.ceph.com/keys/release.asc
ceph_stable_release: reef
ceph_stable_release: squid
ceph_stable_repo: "{{ ceph_mirror }}/debian-{{ ceph_stable_release }}"

nfs_ganesha_stable: true # use stable repos for nfs-ganesha
Expand Down
4 changes: 2 additions & 2 deletions roles/ceph-validate/tasks/check_repository.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

- name: Validate ceph_repository_community
ansible.builtin.fail:
msg: "ceph_stable_release must be 'reef'"
msg: "ceph_stable_release must be 'squid'"
when:
- ceph_origin == 'repository'
- ceph_repository == 'community'
- ceph_stable_release not in ['reef']
- ceph_stable_release not in ['squid']
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ def node(host, request):
'pacific': 16,
'quincy': 17,
'reef': 18,
'squid': 19,
'dev': 99
}

Expand Down
2 changes: 1 addition & 1 deletion tests/functional/add-mgrs/group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ ceph_conf_overrides:
mon_allow_pool_size_one: true
mon_warn_on_pool_no_redundancy: false
osd_pool_default_size: 1
dashboard_enabled: False
dashboard_enabled: False
2 changes: 1 addition & 1 deletion tests/functional/add-mons/group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ ceph_conf_overrides:
mon_allow_pool_size_one: true
mon_warn_on_pool_no_redundancy: false
osd_pool_default_size: 1
dashboard_enabled: False
dashboard_enabled: False
4 changes: 2 additions & 2 deletions tests/functional/all_daemons/group_vars/all
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
ceph_origin: repository
ceph_repository: community
public_network: "192.168.1.0/24"
cluster_network: "192.168.2.0/24"
public_network: "192.168.110.0/24"
cluster_network: "192.168.220.0/24"
radosgw_interface: "{{ 'eth1' if ansible_facts['distribution'] == 'CentOS' else 'ens6' }}"
ceph_conf_overrides:
global:
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/all_daemons/vagrant_variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ mgr_vms: 1
ceph_install_source: stable

# SUBNETS TO USE FOR THE VMS
public_subnet: 192.168.1
cluster_subnet: 192.168.2
public_subnet: 192.168.110
cluster_subnet: 192.168.220

# MEMORY
# set 1024 for CentOS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ handler_health_mon_check_delay: 10
handler_health_osd_check_delay: 10
ceph_docker_registry: quay.io
ceph_docker_image: ceph/daemon-base
ceph_docker_image_tag: latest-reef
ceph_docker_image_tag: latest-main
2 changes: 1 addition & 1 deletion tests/functional/lvm-osds/container/group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ handler_health_mon_check_delay: 10
handler_health_osd_check_delay: 10
ceph_docker_registry: quay.io
ceph_docker_image: ceph/daemon-base
ceph_docker_image_tag: latest-reef
ceph_docker_image_tag: latest-main
2 changes: 1 addition & 1 deletion tests/functional/shrink_mgr/group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ ceph_conf_overrides:
mon_allow_pool_size_one: true
mon_warn_on_pool_no_redundancy: false
osd_pool_default_size: 1
dashboard_enabled: False
dashboard_enabled: False
6 changes: 4 additions & 2 deletions tox-subset_update.ini
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ commands=

ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/tests/functional/setup.yml

ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "\
non_container: ansible-playbook -vv --diff -i "localhost," -c local {toxinidir}/tests/functional/dev_setup.yml --extra-vars "dev_setup=True change_dir={changedir} ceph_dev_branch={env:UPDATE_CEPH_DEV_BRANCH:main} ceph_dev_sha1={env:UPDATE_CEPH_DEV_SHA1:latest}" --tags "vagrant_setup"

ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "\
yes_i_know=true \
delegate_facts_host={env:DELEGATE_FACTS_HOST:True} \
ceph_docker_registry_auth=True \
Expand Down Expand Up @@ -102,6 +104,6 @@ commands=
"


bash -c "CEPH_STABLE_RELEASE=reef py.test --reruns 5 --reruns-delay 1 -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/{env:INVENTORY} --ssh-config={changedir}/vagrant_ssh_config {toxinidir}/tests/functional/tests"
bash -c "CEPH_STABLE_RELEASE=squid py.test --reruns 5 --reruns-delay 1 -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/{env:INVENTORY} --ssh-config={changedir}/vagrant_ssh_config {toxinidir}/tests/functional/tests"

vagrant destroy --force
22 changes: 12 additions & 10 deletions tox-update.ini
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,28 @@ setenv=
deps= -r{toxinidir}/tests/requirements.txt
changedir={toxinidir}/tests/functional/all_daemons{env:CONTAINER_DIR:}
commands=
# use the stable-7.0 branch to deploy an octopus cluster
git clone -b stable-7.0 --single-branch https://github.com/ceph/ceph-ansible.git {envdir}/tmp/ceph-ansible
bash {toxinidir}/tests/scripts/vagrant_up.sh {changedir} --no-provision {posargs:--provider=virtualbox}
bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir}

bash {envdir}/tmp/ceph-ansible/tests/scripts/vagrant_up.sh {envdir}/tmp/ceph-ansible/tests/functional/all_daemons{env:CONTAINER_DIR:} --no-provision {posargs:--provider=virtualbox}
bash {envdir}/tmp/ceph-ansible/tests/scripts/generate_ssh_config.sh {envdir}/tmp/ceph-ansible/tests/functional/all_daemons{env:CONTAINER_DIR:}

ansible-galaxy collection install -r {envdir}/tmp/ceph-ansible/requirements.yml -v -p {envdir}/ansible_collections

ansible-playbook -vv --diff -i {envdir}/tmp/ceph-ansible/tests/functional/all_daemons{env:CONTAINER_DIR:}/hosts {envdir}/tmp/ceph-ansible/tests/functional/setup.yml
ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/tests/functional/setup.yml

pip install -r {envdir}/tmp/ceph-ansible/tests/requirements.txt
bash -c 'ANSIBLE_CONFIG={envdir}/tmp/ceph-ansible/ansible.cfg ansible-playbook -vv --diff -i {envdir}/tmp/ceph-ansible/tests/functional/all_daemons{env:CONTAINER_DIR:}/hosts {envdir}/tmp/ceph-ansible/tests/functional/setup.yml'
# configure lvm, we exclude osd2 given this node uses lvm batch scenario (see corresponding inventory host file)
bash -c 'ANSIBLE_CONFIG={envdir}/tmp/ceph-ansible/ansible.cfg ansible-playbook -vv --diff -i {envdir}/tmp/ceph-ansible/tests/functional/all_daemons{env:CONTAINER_DIR:}/hosts {envdir}/tmp/ceph-ansible/tests/functional/lvm_setup.yml --extra-vars "osd_scenario=lvm" --limit 'osds:!osd2''
# # use the stable-7.0 branch to deploy an octopus cluster
# git clone -b stable-7.0 --single-branch https://github.com/ceph/ceph-ansible.git {envdir}/tmp/ceph-ansible
# pip install -r {envdir}/tmp/ceph-ansible/tests/requirements.txt
# bash -c 'ANSIBLE_CONFIG={envdir}/tmp/ceph-ansible/ansible.cfg ansible-playbook -vv --diff -i {envdir}/tmp/ceph-ansible/tests/functional/all_daemons{env:CONTAINER_DIR:}/hosts {envdir}/tmp/ceph-ansible/tests/functional/setup.yml'
# # configure lvm, we exclude osd2 given this node uses lvm batch scenario (see corresponding inventory host file)
# bash -c 'ANSIBLE_CONFIG={envdir}/tmp/ceph-ansible/ansible.cfg ansible-playbook -vv --diff -i {envdir}/tmp/ceph-ansible/tests/functional/all_daemons{env:CONTAINER_DIR:}/hosts {envdir}/tmp/ceph-ansible/tests/functional/lvm_setup.yml --extra-vars "osd_scenario=lvm"'

# configure lvm, we exclude osd2 given this node uses lvm batch scenario (see corresponding inventory host file)
ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/tests/functional/lvm_setup.yml --limit 'osds:!osd2'

ansible-playbook -vv --diff -i {envdir}/tmp/ceph-ansible/tests/functional/all_daemons{env:CONTAINER_DIR:}/hosts {envdir}/tmp/ceph-ansible/{env:PLAYBOOK:site.yml.sample} --limit !nfs0 --extra-vars "\
non_container: ansible-playbook -vv --diff -i "localhost," -c local {toxinidir}/tests/functional/dev_setup.yml --extra-vars "dev_setup=True change_dir={changedir} ceph_dev_branch={env:UPDATE_CEPH_DEV_BRANCH:main} ceph_dev_sha1={env:UPDATE_CEPH_DEV_SHA1:latest}" --tags "vagrant_setup"
ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "\
yes_i_know=true \
delegate_facts_host={env:DELEGATE_FACTS_HOST:True} \
container_package_name=podman \
Expand All @@ -75,7 +78,6 @@ commands=
ceph_docker_registry_password={env:DOCKER_HUB_PASSWORD} \
"

bash -c "CEPH_STABLE_RELEASE=reef py.test --reruns 5 --reruns-delay 1 -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts --ssh-config={envdir}/tmp/ceph-ansible/tests/functional/all_daemons{env:CONTAINER_DIR:}/vagrant_ssh_config {toxinidir}/tests/functional/tests"
# bash -c "CEPH_STABLE_RELEASE=reef py.test --reruns 5 --reruns-delay 1 -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={envdir}/tmp/ceph-ansible/tests/functional/all_daemons{env:CONTAINER_DIR:}/hosts --ssh-config={envdir}/tmp/ceph-ansible/tests/functional/all_daemons{env:CONTAINER_DIR:}/vagrant_ssh_config {toxinidir}/tests/functional/tests"
bash -c "CEPH_STABLE_RELEASE=squid py.test --reruns 5 --reruns-delay 1 -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/{env:INVENTORY} --ssh-config={changedir}/vagrant_ssh_config {toxinidir}/tests/functional/tests"

vagrant destroy --force
7 changes: 5 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ commands=
[storage-inventory]
commands=
ansible-playbook -vv --diff -i {changedir}/hosts {toxinidir}/infrastructure-playbooks/storage-inventory.yml --extra-vars "\
ceph_docker_image_tag={env:CEPH_DOCKER_IMAGE_TAG:latest-reef} \
ceph_docker_image_tag={env:CEPH_DOCKER_IMAGE_TAG:latest-main} \
"

[cephadm-adopt]
Expand Down Expand Up @@ -319,6 +319,7 @@ changedir=

commands=
ansible-galaxy collection install -r {toxinidir}/requirements.yml -v -p {envdir}/ansible_collections
non_container: ansible-playbook -vv --diff -i "localhost," -c local {toxinidir}/tests/functional/dev_setup.yml --extra-vars "dev_setup={env:DEV_SETUP:False} change_dir={changedir} ceph_dev_branch={env:CEPH_DEV_BRANCH:main} ceph_dev_sha1={env:CEPH_DEV_SHA1:latest}" --tags "vagrant_setup"

bash {toxinidir}/tests/scripts/vagrant_up.sh {changedir} --no-provision {posargs:--provider=virtualbox}
bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir}
Expand All @@ -333,6 +334,8 @@ commands=
ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "\
no_log_on_ceph_key_tasks=false \
yes_i_know=true \
ceph_dev_branch={env:CEPH_DEV_BRANCH:main} \
ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \
ceph_docker_registry_auth=True \
ceph_docker_registry_username={env:DOCKER_HUB_USERNAME} \
ceph_docker_registry_password={env:DOCKER_HUB_PASSWORD} \
Expand All @@ -348,7 +351,7 @@ commands=
all_daemons,all_daemons_ipv6,collocation: py.test --reruns 20 --reruns-delay 3 -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/{env:INVENTORY} --ssh-config={changedir}/vagrant_ssh_config {toxinidir}/tests/functional/tests

# handlers/idempotency test
all_daemons,all_daemon_ipv6,all_in_one,collocation: ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "no_log_on_ceph_key_tasks=false delegate_facts_host={env:DELEGATE_FACTS_HOST:True} yes_i_know=true" --extra-vars @ceph-override.json
all_daemons,all_daemon_ipv6,all_in_one,collocation: ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "no_log_on_ceph_key_tasks=false delegate_facts_host={env:DELEGATE_FACTS_HOST:True} ceph_docker_image_tag={env:CEPH_DOCKER_IMAGE_TAG_BIS:latest-bis-main} ceph_dev_branch={env:CEPH_DEV_BRANCH:main} ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} yes_i_know=true" --extra-vars @ceph-override.json

purge: {[purge]commands}
purge_dashboard: {[purge-dashboard]commands}
Expand Down

0 comments on commit 06fdc3a

Please sign in to comment.