diff --git a/cephadm-clients.yml b/cephadm-clients.yml index 5c65720..3385695 100644 --- a/cephadm-clients.yml +++ b/cephadm-clients.yml @@ -154,7 +154,7 @@ changed_when: false register: result until: result is succeeded - when: ansible_facts['distribution'] == 'CentOS' or ansible_facts['distribution'] == 'RedHat' + when: ansible_facts['os_family'] == 'RedHat' - name: install ceph client prerequisites if needed package: diff --git a/cephadm-preflight.yml b/cephadm-preflight.yml index 846069a..4ca5d3d 100644 --- a/cephadm-preflight.yml +++ b/cephadm-preflight.yml @@ -44,7 +44,7 @@ name: ceph_defaults - name: redhat family of OS related tasks - when: ansible_facts['distribution'] == 'CentOS' or ansible_facts['distribution'] == 'RedHat' + when: ansible_facts['os_family'] == 'RedHat' block: - name: rhcs related tasks when: ceph_origin == 'rhcs' @@ -163,7 +163,7 @@ loop: "{{ ceph_custom_repositories }}" - name: install epel-release - when: ansible_facts['distribution'] == 'CentOS' + when: ansible_facts['distribution'] != 'RedHat' block: - name: enable required CentOS repository for epel command: dnf config-manager --set-enabled "{{ 'powertools' if ansible_facts['distribution_major_version'] == '8' else 'crb' }}" @@ -257,12 +257,18 @@ - name: install prerequisites packages apt: - name: "{{ ['python3','cephadm','ceph-common'] }}" + name: "{{ ['python3','chrony'] + ceph_pkgs }}" state: "{{ (upgrade_ceph_packages | bool) | ternary('latest', 'present') }}" update_cache: true register: result until: result is succeeded + - name: ensure chronyd is running + service: + name: chronyd + state: started + enabled: true + - name: install container engine block: - name: install podman diff --git a/requirements.txt b/requirements.txt index 41bb242..3f873d8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ -testinfra>=3,<4 -pytest-xdist==1.28.0 -pytest>=4.6,<5.0 -ansible>=2.9,<2.10,!=2.9.10 -Jinja2>=2.10 +pytest-testinfra +pytest-xdist +pytest +ansible>4,<9 +Jinja2 diff --git a/tests/functional/conftest.py b/tests/functional/conftest.py index 0bd13b4..a53aa61 100644 --- a/tests/functional/conftest.py +++ b/tests/functional/conftest.py @@ -4,7 +4,7 @@ def node(host, request): ansible_vars = host.ansible.get_variables() - if request.node.get_closest_marker("no_client") and ansible_vars['group_names'] == ['clients']: + if request.node.get_closest_marker("no_client") and 'clients' in ansible_vars['group_names']: pytest.skip("Not a valid test for client nodes") if request.node.get_closest_marker("client") and 'clients' not in ansible_vars['group_names']: diff --git a/tests/functional/pytest.ini b/tests/functional/pytest.ini index 73b7c9a..ce242a9 100644 --- a/tests/functional/pytest.ini +++ b/tests/functional/pytest.ini @@ -1,3 +1,6 @@ [pytest] markers = admin: for admin nodes + no_client: for non client nodes + client: for client nodes + osd: for osd nodes diff --git a/tests/requirements.txt b/tests/requirements.txt index 41bb242..3f873d8 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,5 +1,5 @@ -testinfra>=3,<4 -pytest-xdist==1.28.0 -pytest>=4.6,<5.0 -ansible>=2.9,<2.10,!=2.9.10 -Jinja2>=2.10 +pytest-testinfra +pytest-xdist +pytest +ansible>4,<9 +Jinja2 diff --git a/tox.ini b/tox.ini index 321e5af..35fad01 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] envlist = flake8,mypy,unittests - {el8,el9}-{functional} + {el8,el9,rocky8,rocky9,ubuntu_lts}-{functional} skipsdist = True [testenv:mypy] @@ -27,7 +27,7 @@ setenv= PYTHONPATH = {env:PYTHONPATH:}:{toxinidir}/library:{toxinidir}/module_utils:{toxinidir}/tests/library commands = py.test -vvv -n=auto {toxinidir}/tests/library/ {toxinidir}/tests/module_utils -[testenv:{el8,el9}-functional] +[testenv:{el8,el9,rocky8,rocky9,ubuntu_lts}-functional] allowlist_externals = vagrant bash @@ -38,6 +38,9 @@ setenv= # Set the vagrant box image to use el8: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream8 el9: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream9 + rocky8: CEPH_ANSIBLE_VAGRANT_BOX = generic/rocky8 + rocky9: CEPH_ANSIBLE_VAGRANT_BOX = generic/rocky9 + ubuntu_lts: CEPH_ANSIBLE_VAGRANT_BOX = generic/ubuntu2204 ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey ANSIBLE_CONFIG = {toxinidir}/ansible.cfg ANSIBLE_CALLBACK_WHITELIST = profile_tasks @@ -55,7 +58,8 @@ commands= bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir} # Get a system up-to-date before deploying - ansible -vv -i {changedir}/hosts all -b -m command -a 'dnf update -y' + {el,rock}{8,9}: ansible -vv -i {changedir}/hosts all -b -m dnf -a 'name="*" state=latest' + ubuntu_lts: ansible -vv -i {changedir}/hosts all -b -m apt -a 'name="*" state=latest update_cache=true' # Install prerequisites ansible-playbook -vv -i {changedir}/hosts {toxinidir}/cephadm-preflight.yml --extra-vars "\