Skip to content

Commit

Permalink
Merge pull request #263 from asm0deuz/support_rockylinux
Browse files Browse the repository at this point in the history
Add RockyLinux support
  • Loading branch information
asm0deuz authored Dec 6, 2023
2 parents c9ba082 + 807bc9c commit a51f517
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 18 deletions.
2 changes: 1 addition & 1 deletion cephadm-clients.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
12 changes: 9 additions & 3 deletions cephadm-preflight.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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' }}"
Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion tests/functional/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']:
Expand Down
3 changes: 3 additions & 0 deletions tests/functional/pytest.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[pytest]
markers =
admin: for admin nodes
no_client: for non client nodes
client: for client nodes
osd: for osd nodes
10 changes: 5 additions & 5 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -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
10 changes: 7 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
envlist =
flake8,mypy,unittests
{el8,el9}-{functional}
{el8,el9,rocky8,rocky9,ubuntu_lts}-{functional}
skipsdist = True

[testenv:mypy]
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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 "\
Expand Down

0 comments on commit a51f517

Please sign in to comment.