add CentOS stream 9 support

This adds the resquired changes in order to support
CentOS stream 9.

Also, this bumps the Ansible version support to 2.15

Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
pull/7474/head
Guillaume Abrioux 2023-06-02 11:34:15 +02:00
parent a9d1ec844d
commit 7909778d0e
21 changed files with 52 additions and 53 deletions

View File

@ -10,7 +10,7 @@ jobs:
with: with:
python-version: '3.8' python-version: '3.8'
architecture: x64 architecture: x64
- run: pip install -r <(grep ansible tests/requirements.txt) ansible-lint==4.3.7 'rich>=9.5.1,<11.0.0' netaddr - run: pip install -r <(grep ansible tests/requirements.txt) ansible-lint==6.16.0 netaddr
- run: ansible-galaxy install -r requirements.yml - run: ansible-galaxy install -r requirements.yml
- run: ansible-lint -x 106,204,205,208 -v --force-color ./roles/*/ ./infrastructure-playbooks/*.yml site-container.yml.sample site-container.yml.sample dashboard.yml - run: ansible-lint -x 106,204,205,208 -v --force-color ./roles/*/ ./infrastructure-playbooks/*.yml site-container.yml.sample site-container.yml.sample dashboard.yml
- run: ansible-playbook -i ./tests/functional/all_daemons/hosts site.yml.sample --syntax-check --list-tasks -vv - run: ansible-playbook -i ./tests/functional/all_daemons/hosts site.yml.sample --syntax-check --list-tasks -vv

View File

@ -15,8 +15,8 @@ Obsoletes: ceph-iscsi-ansible <= 1.5
BuildArch: noarch BuildArch: noarch
BuildRequires: ansible >= 2.9 BuildRequires: ansible-core >= 2.14
Requires: ansible >= 2.9 Requires: ansible-core >= 2.14
%if 0%{?rhel} == 7 %if 0%{?rhel} == 7
BuildRequires: python2-devel BuildRequires: python2-devel

View File

@ -12,6 +12,10 @@
gather_facts: false gather_facts: false
become: true become: true
pre_tasks: pre_tasks:
- import_role:
name: ceph-defaults
tags: ['ceph_update_config']
- name: set ceph node exporter install 'In Progress' - name: set ceph node exporter install 'In Progress'
run_once: true run_once: true
set_stats: set_stats:
@ -21,9 +25,6 @@
start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}" start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
tasks: tasks:
- import_role:
name: ceph-defaults
tags: ['ceph_update_config']
- import_role: - import_role:
name: ceph-facts name: ceph-facts
tags: ['ceph_update_config'] tags: ['ceph_update_config']
@ -47,10 +48,14 @@
status: "Complete" status: "Complete"
end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}" end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
- hosts: "{{ monitoring_group_name }}" - hosts: "{{ monitoring_group_name | default('monitoring') }}"
gather_facts: false gather_facts: false
become: true become: true
pre_tasks: pre_tasks:
- import_role:
name: ceph-defaults
tags: ['ceph_update_config']
- name: set ceph grafana install 'In Progress' - name: set ceph grafana install 'In Progress'
run_once: true run_once: true
set_stats: set_stats:
@ -60,9 +65,6 @@
start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}" start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
tasks: tasks:
- import_role:
name: ceph-defaults
tags: ['ceph_update_config']
- import_role: - import_role:
name: ceph-facts name: ceph-facts
tags: ['ceph_update_config'] tags: ['ceph_update_config']
@ -86,10 +88,14 @@
# using groups[] here otherwise it can't fallback to the mon if there's no mgr group. # using groups[] here otherwise it can't fallback to the mon if there's no mgr group.
# adding an additional | default(omit) in case where no monitors are present (external ceph cluster) # adding an additional | default(omit) in case where no monitors are present (external ceph cluster)
- hosts: "{{ groups[mgr_group_name] | default(groups[mon_group_name]) | default(omit) }}" - hosts: "{{ groups[mgr_group_name|default('mgrs')] | default(groups[mon_group_name|default('mons')]) | default(omit) }}"
gather_facts: false gather_facts: false
become: true become: true
pre_tasks: pre_tasks:
- import_role:
name: ceph-defaults
tags: ['ceph_update_config']
- name: set ceph dashboard install 'In Progress' - name: set ceph dashboard install 'In Progress'
run_once: true run_once: true
set_stats: set_stats:
@ -99,9 +105,6 @@
start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}" start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
tasks: tasks:
- import_role:
name: ceph-defaults
tags: ['ceph_update_config']
- import_role: - import_role:
name: ceph-facts name: ceph-facts
tags: ['ceph_update_config'] tags: ['ceph_update_config']

View File

@ -1000,13 +1000,9 @@
- name: remove package dependencies on redhat - name: remove package dependencies on redhat
command: yum -y autoremove command: yum -y autoremove
args:
warn: no
- name: remove package dependencies on redhat again - name: remove package dependencies on redhat again
command: yum -y autoremove command: yum -y autoremove
args:
warn: no
when: when:
ansible_facts['pkg_mgr'] == "yum" ansible_facts['pkg_mgr'] == "yum"
@ -1019,13 +1015,9 @@
- name: remove package dependencies on redhat - name: remove package dependencies on redhat
command: dnf -y autoremove command: dnf -y autoremove
args:
warn: no
- name: remove package dependencies on redhat again - name: remove package dependencies on redhat again
command: dnf -y autoremove command: dnf -y autoremove
args:
warn: no
when: when:
ansible_facts['pkg_mgr'] == "dnf" ansible_facts['pkg_mgr'] == "dnf"
when: when:

View File

@ -148,6 +148,8 @@
become: True become: True
gather_facts: false gather_facts: false
tasks: tasks:
- import_role:
name: ceph-defaults
- name: upgrade ceph mon cluster - name: upgrade ceph mon cluster
block: block:
- name: remove ceph aliases - name: remove ceph aliases
@ -169,8 +171,6 @@
set_fact: set_fact:
mon_host: "{{ groups[mon_group_name] | difference([inventory_hostname]) | last }}" mon_host: "{{ groups[mon_group_name] | difference([inventory_hostname]) | last }}"
- import_role:
name: ceph-defaults
- import_role: - import_role:
name: ceph-facts name: ceph-facts
@ -305,6 +305,9 @@
delay: "{{ health_mon_check_delay }}" delay: "{{ health_mon_check_delay }}"
when: containerized_deployment | bool when: containerized_deployment | bool
rescue: rescue:
- import_role:
name: ceph-defaults
- name: unmask the mon service - name: unmask the mon service
systemd: systemd:
name: ceph-mon@{{ ansible_facts['hostname'] }} name: ceph-mon@{{ ansible_facts['hostname'] }}
@ -1112,7 +1115,7 @@
name: ceph-node-exporter name: ceph-node-exporter
- name: upgrade monitoring node - name: upgrade monitoring node
hosts: "{{ monitoring_group_name }}" hosts: "{{ monitoring_group_name|default('monitoring') }}"
tags: monitoring tags: monitoring
gather_facts: false gather_facts: false
become: true become: true
@ -1144,7 +1147,7 @@
name: ceph-grafana name: ceph-grafana
- name: upgrade ceph dashboard - name: upgrade ceph dashboard
hosts: "{{ groups[mgr_group_name] | default(groups[mon_group_name]) | default(omit) }}" hosts: "{{ groups[mgr_group_name|default('mgrs')] | default(groups[mon_group_name|default('mons')]) | default(omit) }}"
tags: monitoring tags: monitoring
gather_facts: false gather_facts: false
become: true become: true

View File

@ -1,4 +1,4 @@
# These are Python requirements needed to run ceph-ansible main # These are Python requirements needed to run ceph-ansible main
ansible-core>=2.12,<2.13 ansible-core>=2.14,<2.15,!=2.9.10
netaddr netaddr
six six

View File

@ -0,0 +1,3 @@
---
container_package_name: podman
container_service_name: podman

View File

@ -6,5 +6,5 @@
- name: set_fact container_binary - name: set_fact container_binary
set_fact: set_fact:
container_binary: "{{ 'podman' if (podman_binary.stat.exists and ansible_facts['distribution'] == 'Fedora') or (ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version'] == '8') else 'docker' }}" container_binary: "{{ 'podman' if (podman_binary.stat.exists and ansible_facts['distribution'] == 'Fedora') or (ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version'] in ['8', '9']) else 'docker' }}"
when: not docker2podman | default(false) | bool when: not docker2podman | default(false) | bool

View File

@ -1,8 +1,6 @@
--- ---
- name: check firewalld installation on redhat or SUSE/openSUSE - name: check firewalld installation on redhat or SUSE/openSUSE
command: rpm -q firewalld command: rpm -q firewalld
args:
warn: no
register: firewalld_pkg_query register: firewalld_pkg_query
ignore_errors: true ignore_errors: true
check_mode: no check_mode: no

View File

@ -6,8 +6,8 @@
- name: fail on unsupported ansible version - name: fail on unsupported ansible version
fail: fail:
msg: "Ansible version must be 2.12!" msg: "Ansible version must be 2.14!"
when: ansible_version.minor|int != 12 when: ansible_version.minor|int != 14
- name: fail on unsupported system - name: fail on unsupported system
fail: fail:

View File

@ -34,6 +34,8 @@
tasks: tasks:
# pre-tasks for following import - # pre-tasks for following import -
- import_role:
name: ceph-defaults
- name: gather facts - name: gather facts
setup: setup:
gather_subset: gather_subset:
@ -56,8 +58,6 @@
when: delegate_facts_host | bool when: delegate_facts_host | bool
tags: always tags: always
- import_role:
name: ceph-defaults
# dummy container setup is only supported on x86_64 # dummy container setup is only supported on x86_64
# when running with containerized_deployment: true this task # when running with containerized_deployment: true this task
@ -503,7 +503,7 @@
- name: set_fact container_binary - name: set_fact container_binary
set_fact: set_fact:
container_binary: "{{ 'podman' if (podman_binary.stat.exists and ansible_facts['distribution'] == 'Fedora') or (ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version'] == '8') else 'docker' }}" container_binary: "{{ 'podman' if (podman_binary.stat.exists and ansible_facts['distribution'] == 'Fedora') or (ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version'] in ['8', '9']) else 'docker' }}"
- name: get ceph status from the first monitor - name: get ceph status from the first monitor
command: > command: >

View File

@ -34,6 +34,8 @@
delegate_facts_host: True delegate_facts_host: True
pre_tasks: pre_tasks:
- import_role:
name: ceph-defaults
# If we can't get python2 installed before any module is used we will fail # If we can't get python2 installed before any module is used we will fail
# so just try what we can to get it installed # so just try what we can to get it installed
@ -61,8 +63,6 @@
when: delegate_facts_host | bool when: delegate_facts_host | bool
tasks: tasks:
- import_role:
name: ceph-defaults
# dummy container setup is only supported on x86_64 # dummy container setup is only supported on x86_64
# when running with containerized_deployment: true this task # when running with containerized_deployment: true this task

View File

@ -2,7 +2,7 @@
pytest-testinfra pytest-testinfra
pytest-xdist pytest-xdist
pytest pytest
ansible-core>=2.12,<2.13,!=2.9.10 ansible-core>=2.14,<2.15,!=2.9.10
Jinja2>=2.10 Jinja2>=2.10
netaddr netaddr
mock mock

View File

@ -22,7 +22,7 @@ setenv=
# only available for ansible >= 2.5 # only available for ansible >= 2.5
ANSIBLE_STDOUT_CALLBACK = yaml ANSIBLE_STDOUT_CALLBACK = yaml
# Set the vagrant box image to use # Set the vagrant box image to use
CEPH_ANSIBLE_VAGRANT_BOX = centos/stream8 CEPH_ANSIBLE_VAGRANT_BOX = centos/stream9
deps= -r{toxinidir}/tests/requirements.txt deps= -r{toxinidir}/tests/requirements.txt
changedir= {toxinidir}/tests/functional/cephadm changedir= {toxinidir}/tests/functional/cephadm

View File

@ -21,8 +21,8 @@ setenv=
ANSIBLE_STDOUT_CALLBACK = yaml ANSIBLE_STDOUT_CALLBACK = yaml
# non_container: DEV_SETUP = True # non_container: DEV_SETUP = True
# Set the vagrant box image to use # Set the vagrant box image to use
centos-non_container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream8 centos-non_container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream9
centos-container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream8 centos-container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream9
container: CONTAINER_DIR = /container container: CONTAINER_DIR = /container
container: PLAYBOOK = site-container.yml.sample container: PLAYBOOK = site-container.yml.sample

View File

@ -22,7 +22,7 @@ setenv=
# only available for ansible >= 2.5 # only available for ansible >= 2.5
ANSIBLE_STDOUT_CALLBACK = yaml ANSIBLE_STDOUT_CALLBACK = yaml
# Set the vagrant box image to use # Set the vagrant box image to use
CEPH_ANSIBLE_VAGRANT_BOX = centos/stream8 CEPH_ANSIBLE_VAGRANT_BOX = centos/stream9
# Set the ansible inventory host file to be used according to which distrib we are running on # Set the ansible inventory host file to be used according to which distrib we are running on
INVENTORY = {env:_INVENTORY:hosts} INVENTORY = {env:_INVENTORY:hosts}

View File

@ -21,8 +21,8 @@ setenv=
ANSIBLE_STDOUT_CALLBACK = yaml ANSIBLE_STDOUT_CALLBACK = yaml
# non_container: DEV_SETUP = True # non_container: DEV_SETUP = True
# Set the vagrant box image to use # Set the vagrant box image to use
centos-non_container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream8 centos-non_container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream9
centos-container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream8 centos-container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream9
INVENTORY = {env:_INVENTORY:hosts} INVENTORY = {env:_INVENTORY:hosts}
container: CONTAINER_DIR = /container container: CONTAINER_DIR = /container

View File

@ -62,8 +62,8 @@ setenv=
ANSIBLE_STDOUT_CALLBACK = yaml ANSIBLE_STDOUT_CALLBACK = yaml
non_container: DEV_SETUP = True non_container: DEV_SETUP = True
# Set the vagrant box image to use # Set the vagrant box image to use
centos-non_container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream8 centos-non_container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream9
centos-container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream8 centos-container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream9
INVENTORY = {env:_INVENTORY:hosts} INVENTORY = {env:_INVENTORY:hosts}
container: CONTAINER_DIR = /container container: CONTAINER_DIR = /container
container: PLAYBOOK = site-container.yml.sample container: PLAYBOOK = site-container.yml.sample

View File

@ -21,8 +21,8 @@ setenv=
ANSIBLE_STDOUT_CALLBACK = yaml ANSIBLE_STDOUT_CALLBACK = yaml
# non_container: DEV_SETUP = True # non_container: DEV_SETUP = True
# Set the vagrant box image to use # Set the vagrant box image to use
centos-non_container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream8 centos-non_container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream9
centos-container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream8 centos-container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream9
INVENTORY = {env:_INVENTORY:hosts} INVENTORY = {env:_INVENTORY:hosts}
container: CONTAINER_DIR = /container container: CONTAINER_DIR = /container

View File

@ -21,8 +21,8 @@ setenv=
ANSIBLE_STDOUT_CALLBACK = yaml ANSIBLE_STDOUT_CALLBACK = yaml
# non_container: DEV_SETUP = True # non_container: DEV_SETUP = True
# Set the vagrant box image to use # Set the vagrant box image to use
centos-non_container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream8 centos-non_container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream9
centos-container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream8 centos-container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream9
INVENTORY = {env:_INVENTORY:hosts} INVENTORY = {env:_INVENTORY:hosts}
container: CONTAINER_DIR = /container container: CONTAINER_DIR = /container

View File

@ -313,8 +313,8 @@ setenv=
ANSIBLE_STDOUT_CALLBACK = yaml ANSIBLE_STDOUT_CALLBACK = yaml
non_container: DEV_SETUP = True non_container: DEV_SETUP = True
# Set the vagrant box image to use # Set the vagrant box image to use
centos-non_container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream8 centos-non_container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream9
centos-container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream8 centos-container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream9
INVENTORY = {env:_INVENTORY:hosts} INVENTORY = {env:_INVENTORY:hosts}
container: CONTAINER_DIR = /container container: CONTAINER_DIR = /container
container: PLAYBOOK = site-container.yml.sample container: PLAYBOOK = site-container.yml.sample