]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
add CentOS stream 9 support
authorGuillaume Abrioux <gabrioux@ibm.com>
Fri, 2 Jun 2023 09:34:15 +0000 (11:34 +0200)
committerGuillaume Abrioux <gabrioux@ibm.com>
Wed, 14 Feb 2024 08:54:13 +0000 (09:54 +0100)
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>
21 files changed:
.github/workflows/ansible-lint.yml
ceph-ansible.spec.in
dashboard.yml
infrastructure-playbooks/purge-cluster.yml
infrastructure-playbooks/rolling_update.yml
requirements.txt
roles/ceph-container-engine/vars/CentOS-9.yml [new file with mode: 0644]
roles/ceph-facts/tasks/container_binary.yml
roles/ceph-infra/tasks/configure_firewall.yml
roles/ceph-validate/tasks/check_system.yml
site-container.yml.sample
site.yml.sample
tests/requirements.txt
tox-cephadm.ini
tox-external_clients.ini
tox-podman.ini
tox-rbdmirror.ini
tox-shrink_osd.ini
tox-subset_update.ini
tox-update.ini
tox.ini

index d4994387ed22f627429dd326c9ecbda9f5052afe..9a8b4962ac758080c6423d584a04367a6231a7ee 100644 (file)
@@ -10,7 +10,7 @@ jobs:
         with:
           python-version: '3.8'
           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-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
index fbfa400550696f6a52f5ed216d82fd3751b3575c..fd53c0156affa301d27982fc217747ad92c5ee40 100644 (file)
@@ -15,8 +15,8 @@ Obsoletes:      ceph-iscsi-ansible <= 1.5
 
 BuildArch:      noarch
 
-BuildRequires: ansible >= 2.9
-Requires: ansible >= 2.9
+BuildRequires: ansible-core >= 2.14
+Requires: ansible-core >= 2.14
 
 %if 0%{?rhel} == 7
 BuildRequires: python2-devel
index 6ebec6d207d861467abc3913a3d82401e62cfacd..13624728af2c096a8ed559076a176faafc190b1f 100644 (file)
   gather_facts: false
   become: true
   pre_tasks:
+    - import_role:
+        name: ceph-defaults
+      tags: ['ceph_update_config']
+
     - name: set ceph node exporter install 'In Progress'
       run_once: true
       set_stats:
@@ -21,9 +25,6 @@
             start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
 
   tasks:
-    - import_role:
-        name: ceph-defaults
-      tags: ['ceph_update_config']
     - import_role:
         name: ceph-facts
       tags: ['ceph_update_config']
             status: "Complete"
             end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
 
-- hosts: "{{ monitoring_group_name }}"
+- hosts: "{{ monitoring_group_name | default('monitoring') }}"
   gather_facts: false
   become: true
   pre_tasks:
+    - import_role:
+        name: ceph-defaults
+      tags: ['ceph_update_config']
+
     - name: set ceph grafana install 'In Progress'
       run_once: true
       set_stats:
@@ -60,9 +65,6 @@
             start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
 
   tasks:
-    - import_role:
-        name: ceph-defaults
-      tags: ['ceph_update_config']
     - import_role:
         name: ceph-facts
       tags: ['ceph_update_config']
 
 # 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)
-- 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
   become: true
   pre_tasks:
+    - import_role:
+        name: ceph-defaults
+      tags: ['ceph_update_config']
+
     - name: set ceph dashboard install 'In Progress'
       run_once: true
       set_stats:
             start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
 
   tasks:
-    - import_role:
-        name: ceph-defaults
-      tags: ['ceph_update_config']
     - import_role:
         name: ceph-facts
       tags: ['ceph_update_config']
index c992f9468cf540c84f3976bc29e5c5d165b4a0d4..747ecbc9129c0bb3f4deb44d542e08b48b657fcf 100644 (file)
 
                 - name: remove package dependencies on redhat
                   command: yum -y autoremove
-                  args:
-                    warn: no
 
                 - name: remove package dependencies on redhat again
                   command: yum -y autoremove
-                  args:
-                    warn: no
               when:
                 ansible_facts['pkg_mgr'] == "yum"
 
 
                 - name: remove package dependencies on redhat
                   command: dnf -y autoremove
-                  args:
-                    warn: no
 
                 - name: remove package dependencies on redhat again
                   command: dnf -y autoremove
-                  args:
-                    warn: no
               when:
                 ansible_facts['pkg_mgr'] == "dnf"
           when:
index 198a8316a7b904be192bdf838b73c2bff7aaba12..b6e4c097da85aef9003915c32ee96ab39102e9f4 100644 (file)
   become: True
   gather_facts: false
   tasks:
+    - import_role:
+        name: ceph-defaults
     - name: upgrade ceph mon cluster
       block:
         - name: remove ceph aliases
           set_fact:
             mon_host: "{{ groups[mon_group_name] | difference([inventory_hostname]) | last }}"
 
-        - import_role:
-            name: ceph-defaults
         - import_role:
             name: ceph-facts
 
           delay: "{{ health_mon_check_delay }}"
           when: containerized_deployment | bool
       rescue:
+        - import_role:
+            name: ceph-defaults
+
         - name: unmask the mon service
           systemd:
             name: ceph-mon@{{ ansible_facts['hostname'] }}
             name: ceph-node-exporter
 
 - name: upgrade monitoring node
-  hosts: "{{ monitoring_group_name }}"
+  hosts: "{{ monitoring_group_name|default('monitoring') }}"
   tags: monitoring
   gather_facts: false
   become: true
             name: ceph-grafana
 
 - 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
   gather_facts: false
   become: true
index 4ed60d62d3b86d0b4499a91798a331f0469b11d3..2148d6058310964fa80f878738c5432e323a091b 100644 (file)
@@ -1,4 +1,4 @@
 # 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
 six
diff --git a/roles/ceph-container-engine/vars/CentOS-9.yml b/roles/ceph-container-engine/vars/CentOS-9.yml
new file mode 100644 (file)
index 0000000..a46ed44
--- /dev/null
@@ -0,0 +1,3 @@
+---
+container_package_name: podman
+container_service_name: podman
index 0054f7848ce38ae13ae260e184981431e16789ca..e41c24017ae4a1cc5ef14d3b5d695f00dc725881 100644 (file)
@@ -6,5 +6,5 @@
 
 - name: set_fact container_binary
   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' }}"
-  when: not docker2podman | default(false) | bool
\ No newline at end of file
+    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
index 54dbc4ffdb02542febb2edffab8e9f77511044f4..7469584bfbab9e7c6301edda3aebb9414434f26d 100644 (file)
@@ -1,8 +1,6 @@
 ---
 - name: check firewalld installation on redhat or SUSE/openSUSE
   command: rpm -q firewalld
-  args:
-    warn: no
   register: firewalld_pkg_query
   ignore_errors: true
   check_mode: no
index d404530249c2fb9ffffdcb03e17d385a14e593f7..fb4513a1eb0e2bac5dce06be7aa57f85228646aa 100644 (file)
@@ -6,8 +6,8 @@
 
 - name: fail on unsupported ansible version
   fail:
-    msg: "Ansible version must be 2.12!"
-  when: ansible_version.minor|int != 12
+    msg: "Ansible version must be 2.14!"
+  when: ansible_version.minor|int != 14
 
 - name: fail on unsupported system
   fail:
index d552084ce86cf28761503a464c9adc9ec28a9456..b3b48fa39aa3cb62ef93b7da4e655155dfd223ae 100644 (file)
@@ -34,6 +34,8 @@
 
   tasks:
     # pre-tasks for following import -
+    - import_role:
+        name: ceph-defaults
     - name: gather facts
       setup:
         gather_subset:
@@ -56,8 +58,6 @@
       when: delegate_facts_host | bool
       tags: always
 
-    - import_role:
-        name: ceph-defaults
 
     # dummy container setup is only supported on x86_64
     # when running with containerized_deployment: true this task
 
     - name: set_fact container_binary
       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
       command: >
index 3b66683e5ce9899c7849d8b7013d80c4a7ab6d9d..26a3aa3fe9e890eff68bd1e18f12737e5475fe97 100644 (file)
@@ -34,6 +34,8 @@
     delegate_facts_host: True
 
   pre_tasks:
+    - import_role:
+        name: ceph-defaults
     # 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
 
@@ -61,8 +63,6 @@
       when: delegate_facts_host | bool
 
   tasks:
-    - import_role:
-        name: ceph-defaults
 
     # dummy container setup is only supported on x86_64
     # when running with containerized_deployment: true this task
index 2ed780f6d7be1222a480a7ed0fff12c0cf0f633e..2e55bd36fd8b18d4602a736e2930291cfe0806e3 100644 (file)
@@ -2,7 +2,7 @@
 pytest-testinfra
 pytest-xdist
 pytest
-ansible-core>=2.12,<2.13,!=2.9.10
+ansible-core>=2.14,<2.15,!=2.9.10
 Jinja2>=2.10
 netaddr
 mock
index 2124856d94e77a2511771a57d7b3e9e2d2d2db37..3e0f398d6da095c0570db8da238c71eada72ac53 100644 (file)
@@ -22,7 +22,7 @@ setenv=
   # only available for ansible >= 2.5
   ANSIBLE_STDOUT_CALLBACK = yaml
   # 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
 changedir= {toxinidir}/tests/functional/cephadm
index ad26974a4aed95b1e4f76f20d7e16e7e41a27cdf..dc3ce495013511449c78ac2f887894db50b9ae28 100644 (file)
@@ -21,8 +21,8 @@ setenv=
   ANSIBLE_STDOUT_CALLBACK = yaml
 #  non_container: DEV_SETUP = True
   # Set the vagrant box image to use
-  centos-non_container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream8
-  centos-container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream8
+  centos-non_container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream9
+  centos-container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream9
 
   container: CONTAINER_DIR = /container
   container: PLAYBOOK = site-container.yml.sample
index 08546d4c9d7503c51d50c9de31c43e69c12f0875..cb14914448f380cdb4627374473e8a3f9074deb5 100644 (file)
@@ -22,7 +22,7 @@ setenv=
   # only available for ansible >= 2.5
   ANSIBLE_STDOUT_CALLBACK = yaml
   # 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
   INVENTORY = {env:_INVENTORY:hosts}
index aaa61d1f1a1f9016f2eaf432f0ef8ac88e7bb8ca..84328a7102c41e44ef6ff77cbf28ebc25dddaa83 100644 (file)
@@ -21,8 +21,8 @@ setenv=
   ANSIBLE_STDOUT_CALLBACK = yaml
 #  non_container: DEV_SETUP = True
   # Set the vagrant box image to use
-  centos-non_container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream8
-  centos-container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream8
+  centos-non_container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream9
+  centos-container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream9
 
   INVENTORY = {env:_INVENTORY:hosts}
   container: CONTAINER_DIR = /container
index d5478362e18f14e6df0927987afee1bf6f0ca9f8..6e4001999b0e5bc2eb62178782890c9eccc92ffd 100644 (file)
@@ -62,8 +62,8 @@ setenv=
   ANSIBLE_STDOUT_CALLBACK = yaml
   non_container: DEV_SETUP = True
   # Set the vagrant box image to use
-  centos-non_container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream8
-  centos-container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream8
+  centos-non_container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream9
+  centos-container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream9
   INVENTORY = {env:_INVENTORY:hosts}
   container: CONTAINER_DIR = /container
   container: PLAYBOOK = site-container.yml.sample
index 17dffea109a92451caccf2f70277bd8e6edab1c0..a5b556e5ce29d45475606c9cfe72afca68296d2d 100644 (file)
@@ -21,8 +21,8 @@ setenv=
   ANSIBLE_STDOUT_CALLBACK = yaml
 #  non_container: DEV_SETUP = True
   # Set the vagrant box image to use
-  centos-non_container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream8
-  centos-container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream8
+  centos-non_container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream9
+  centos-container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream9
 
   INVENTORY = {env:_INVENTORY:hosts}
   container: CONTAINER_DIR = /container
index 77771026c803f60cf09072219733dd4b464679c6..9e74b141a81591a813311a1b7e93c0fce7eee6b8 100644 (file)
@@ -21,8 +21,8 @@ setenv=
   ANSIBLE_STDOUT_CALLBACK = yaml
 #  non_container: DEV_SETUP = True
   # Set the vagrant box image to use
-  centos-non_container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream8
-  centos-container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream8
+  centos-non_container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream9
+  centos-container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream9
 
   INVENTORY = {env:_INVENTORY:hosts}
   container: CONTAINER_DIR = /container
diff --git a/tox.ini b/tox.ini
index 679214c317fc0bde88eaf4c9f3f74d6be68c44b5..9934963f29511f882de51dba39c8775c93077a0b 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -313,8 +313,8 @@ setenv=
   ANSIBLE_STDOUT_CALLBACK = yaml
   non_container: DEV_SETUP = True
   # Set the vagrant box image to use
-  centos-non_container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream8
-  centos-container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream8
+  centos-non_container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream9
+  centos-container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream9
   INVENTORY = {env:_INVENTORY:hosts}
   container: CONTAINER_DIR = /container
   container: PLAYBOOK = site-container.yml.sample