Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

common: add centos8 support #4798

Merged
merged 9 commits into from
Jan 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion group_vars/all.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ dummy:

#centos_package_dependencies:
# - epel-release
# - libselinux-python
# - python3-libselinux

#redhat_package_dependencies: []

Expand Down
2 changes: 1 addition & 1 deletion group_vars/rhcs.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ fetch_directory: ~/ceph-ansible-keys

#centos_package_dependencies:
# - epel-release
# - libselinux-python
# - python3-libselinux

#redhat_package_dependencies: []

Expand Down
6 changes: 6 additions & 0 deletions infrastructure-playbooks/purge-container-cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,12 @@

- import_role:
name: ceph-facts
tasks_from: container_binary

- name: remove stopped/exited containers
command: >
{{ container_binary }} container prune{% if container_binary == 'docker' %} -f{% endif %}
changed_when: false

- name: show container list on all the nodes (should be empty)
command: >
Expand Down
25 changes: 4 additions & 21 deletions infrastructure-playbooks/rolling_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -499,23 +499,6 @@
- noout
- nodeep-scrub

- name: get osd versions
command: "{{ container_exec_cmd_update_osd|default('') }} ceph --cluster {{ cluster }} versions"
register: ceph_versions

- name: set_fact ceph_versions_osd
set_fact:
ceph_versions_osd: "{{ (ceph_versions.stdout|from_json).osd }}"

# length == 1 means there is a single osds versions entry
# thus all the osds are running the same version
- name: complete osds upgrade
command: "{{ container_exec_cmd_update_osd|default('') }} ceph --cluster {{ cluster }} osd require-osd-release luminous"
when:
- (ceph_versions.get('stdout', '{}')|from_json).get('osd', {}) | length == 1
- ceph_versions_osd | string is search("ceph version 12")


- name: upgrade ceph mdss cluster, deactivate all rank > 0
hosts: "{{ groups[mon_group_name|default('mons')][0] }}"
become: true
Expand Down Expand Up @@ -926,14 +909,14 @@
- import_role:
name: ceph-facts

- name: container | disallow pre-nautilus OSDs and enable all new nautilus-only functionality
command: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }} ceph osd require-osd-release nautilus"
- name: container | disallow pre-octopus OSDs and enable all new octopus-only functionality
command: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }} ceph osd require-osd-release octopus"
delegate_to: "{{ groups[mon_group_name][0] }}"
run_once: True
when: containerized_deployment | bool

- name: non container | disallow pre-nautilus OSDs and enable all new nautilus-only functionality
command: "ceph --cluster {{ cluster }} osd require-osd-release nautilus"
- name: non container | disallow pre-octopus OSDs and enable all new octopus-only functionality
command: "ceph --cluster {{ cluster }} osd require-osd-release octopus"
delegate_to: "{{ groups[mon_group_name][0] }}"
run_once: True
when: not containerized_deployment | bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
register: result
until: result is succeeded
tags: with_pkg
when: ansible_distribution_major_version | int == 7

- name: configure red hat ceph community repository stable key
rpm_key:
Expand Down
23 changes: 23 additions & 0 deletions roles/ceph-common/tasks/installs/redhat_dev_repository.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,27 @@
---
- name: install dnf-plugins-core
package:
name: dnf-plugins-core
register: result
until: result is succeeded
tags: with_pkg

- name: enable ceph-el8 copr
command: dnf copr enable -y ktdreyer/ceph-el8
args:
creates: /etc/yum.repos.d/_copr:copr.fedorainfracloud.org:ktdreyer:ceph-el8.repo
warn: false
register: result
until: result is succeeded

- name: enable ceph lab extras repository
yum_repository:
name: lab-extras
baseurl: http://apt-mirror.front.sepia.ceph.com/lab-extras/8/
description: Sepia Lab Extras repository
enabled: true
gpgcheck: false

- name: fetch ceph red hat development repository
uri:
# Use the centos repo since we don't currently have a dedicated red hat repo
Expand Down
2 changes: 1 addition & 1 deletion roles/ceph-container-engine/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
- name: include pre_requisites/prerequisites.yml
include_tasks: pre_requisites/prerequisites.yml
when: not is_atomic
when: not is_atomic | bool
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@
tags:
with_pkg

- name: install container package
- name: install container and lvm2 packages
package:
name: ['{{ container_package_name }}', '{{ container_binding_name }}']
name: ['{{ container_package_name }}', '{{ container_binding_name }}', 'lvm2']
update_cache: true
register: result
until: result is succeeded
tags: with_pkg

- name: start container service
Expand Down
1 change: 1 addition & 0 deletions roles/ceph-container-engine/vars/CentOS-8.yml
2 changes: 1 addition & 1 deletion roles/ceph-defaults/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ debian_package_dependencies: []

centos_package_dependencies:
- epel-release
- libselinux-python
- python3-libselinux

redhat_package_dependencies: []

Expand Down
1 change: 0 additions & 1 deletion roles/ceph-iscsi-gw/tasks/non-container/prerequisites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
- targetcli
common_repos:
- tcmu-runner
- python-rtslib

- name: set_fact base iscsi pkgs if new style ceph-iscsi
set_fact:
Expand Down
17 changes: 8 additions & 9 deletions roles/ceph-nfs/tasks/ganesha_selinux_fix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,16 @@
until: result is succeeded
when: ansible_distribution_major_version == '7'

- name: add ganesha_t to permissive domain
selinux_permissive:
name: ganesha_t
permissive: true
failed_when: false
when: ansible_distribution_major_version == '7'

- name: install nfs-ganesha-selinux on RHEL 8
- name: install nfs-ganesha-selinux and python3-policycoreutils on RHEL 8
package:
name: nfs-ganesha-selinux
name: ['nfs-ganesha-selinux', 'python3-policycoreutils']
state: present
register: result
until: result is succeeded
when: ansible_distribution_major_version == '8'

- name: add ganesha_t to permissive domain
selinux_permissive:
name: ganesha_t
permissive: true
failed_when: false
28 changes: 16 additions & 12 deletions roles/ceph-nfs/tasks/pre_requisite_non_container_red_hat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,23 @@

- name: red hat based systems - dev repo related tasks
block:
- name: fetch nfs-ganesha red hat development repository
uri:
url: https://shaman.ceph.com/api/repos/nfs-ganesha/next/latest/{{ ansible_distribution | lower }}/{{ ansible_distribution_major_version }}/flavors/{{ nfs_ganesha_flavor }}/repo
return_content: yes
register: nfs_ganesha_dev_yum_repo
- name: add nfs-ganesha dev repo
yum_repository:
name: nfs-ganesha
baseurl: https://download.nfs-ganesha.org/3/LATEST/CentOS/el-$releasever/$basearch
description: nfs-ganesha repository
gpgcheck: true
gpgkey: https://download.nfs-ganesha.org/3/rsa.pub
file: nfs-ganesha-dev

- name: add nfs-ganesha development repository
copy:
content: "{{ nfs_ganesha_dev_yum_repo.content }}"
dest: /etc/yum.repos.d/nfs-ganesha-dev.repo
owner: root
group: root
backup: yes
- name: add nfs-ganesha dev noarch repo
yum_repository:
name: nfs-ganesha-noarch
baseurl: https://download.nfs-ganesha.org/3/LATEST/CentOS/el-$releasever/noarch
description: nfs-ganesha noarch repository
gpgcheck: true
gpgkey: https://download.nfs-ganesha.org/3/rsa.pub
file: nfs-ganesha-dev
when:
- nfs_ganesha_dev | bool
- ceph_repository == 'dev'
Expand Down
8 changes: 0 additions & 8 deletions roles/ceph-osd/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,6 @@
- ceph_osd_numactl_opts | length > 0
tags: with_pkg

- name: install lvm2
package:
name: lvm2
register: result
until: result is succeeded
when: not is_atomic | bool
tags: with_pkg

- name: include_tasks common.yml
include_tasks: common.yml

Expand Down
2 changes: 0 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ def setup(host):
address = host.interface(public_interface).addresses[0]

if docker:
container_binary = "docker"
if docker and str_to_bool(os.environ.get('IS_PODMAN', False)): # noqa E501
container_binary = "podman"

data = dict(
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/all_daemons/container/hosts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ mds2
[rgws]
rgw0

[nfss]
nfs0
#[nfss]
#nfs0

[clients]
client0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ mon_vms: 3
osd_vms: 2
mds_vms: 3
rgw_vms: 1
nfs_vms: 1
nfs_vms: 0
grafana_server_vms: 0
rbd_mirror_vms: 1
client_vms: 2
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/all_daemons/hosts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ rgw0
client0
client1

[nfss]
nfs0
#[nfss]
#nfs0

[rbdmirrors]
rbd-mirror0
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/all_daemons/vagrant_variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ mon_vms: 3
osd_vms: 2
mds_vms: 3
rgw_vms: 1
nfs_vms: 1
nfs_vms: 0
grafana_server_vms: 0
rbd_mirror_vms: 1
client_vms: 2
Expand Down
18 changes: 11 additions & 7 deletions tests/functional/rbd_map_devices.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,19 @@
- name: create an rbd image - non container
command: "rbd create --size=1024 test/rbd_test"
delegate_to: "mon0"
when: not is_atomic
when:
- not is_atomic | bool
- not containerized_deployment | default(false) | bool

- name: create an rbd image - container
command: "docker run --rm -v /etc/ceph:/etc/ceph --net=host --entrypoint=rbd {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} create --size=1024 test/rbd_test"
command: "podman run --rm -v /etc/ceph:/etc/ceph --net=host --entrypoint=rbd {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} create --size=1024 test/rbd_test"
delegate_to: "mon0"
when: is_atomic
when: is_atomic | bool or containerized_deployment | default(false) | bool

- name: non container
when: not is_atomic
when:
- not is_atomic | bool
- not containerized_deployment | default(false) | bool
block:
- name: disable features unsupported by the kernel
command: rbd feature disable test/rbd_test object-map fast-diff deep-flatten
Expand All @@ -45,10 +49,10 @@
command: rbd map test/rbd_test

- name: container
when: is_atomic
when: is_atomic | bool or containerized_deployment | default(false) | bool
block:
- name: disable features unsupported by the kernel
command: "docker run --rm -v /etc/ceph:/etc/ceph --net=host --entrypoint=rbd {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} feature disable test/rbd_test object-map fast-diff deep-flatten"
command: "podman run --rm -v /etc/ceph:/etc/ceph --net=host --entrypoint=rbd {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} feature disable test/rbd_test object-map fast-diff deep-flatten"

- name: map a device
command: "docker run --rm --privileged -v /etc/ceph:/etc/ceph -v /dev:/dev --net=host --entrypoint=rbd {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} map test/rbd_test"
command: "podman run --rm --privileged -v /etc/ceph:/etc/ceph -v /dev:/dev --net=host --entrypoint=rbd {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} map test/rbd_test"
4 changes: 2 additions & 2 deletions tests/functional/rgw_multisite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

- name: generate and upload a random 10Mb file - containerized deployment
command: >
docker run --rm --name=rgw_multisite_test --entrypoint=/bin/bash {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} -c 'dd if=/dev/urandom of=/tmp/testinfra.img bs=1M count=10; {{ s3cmd_cmd }} mb s3://testinfra; {{ s3cmd_cmd }} put /tmp/testinfra.img s3://testinfra'
podman run --rm --name=rgw_multisite_test --entrypoint=/bin/bash {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} -c 'dd if=/dev/urandom of=/tmp/testinfra.img bs=1M count=10; {{ s3cmd_cmd }} mb s3://testinfra; {{ s3cmd_cmd }} put /tmp/testinfra.img s3://testinfra'
when:
- rgw_zonemaster | bool
- containerized_deployment | default(False) | bool
Expand All @@ -41,7 +41,7 @@

- name: get info from replicated file - containerized deployment
command: >
docker run --rm --name=rgw_multisite_test --entrypoint=/bin/bash {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} -c '{{ s3cmd_cmd }} info s3://testinfra/testinfra.img'
podman run --rm --name=rgw_multisite_test --entrypoint=/bin/bash {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} -c '{{ s3cmd_cmd }} info s3://testinfra/testinfra.img'
register: s3cmd_info_status
when:
- not rgw_zonemaster | default(False) | bool
Expand Down
1 change: 1 addition & 0 deletions tests/functional/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
state: absent
when:
- ansible_distribution == 'CentOS'
- ansible_distribution_major_version | int == 7
- not is_atomic | bool

- name: resize logical volume for root partition to fill remaining free space
Expand Down
4 changes: 2 additions & 2 deletions tox-filestore_to_bluestore.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,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/7
centos-container: CEPH_ANSIBLE_VAGRANT_BOX = centos/atomic-host
centos-non_container: CEPH_ANSIBLE_VAGRANT_BOX = centos/8
centos-container: CEPH_ANSIBLE_VAGRANT_BOX = centos/8
ubuntu: CEPH_ANSIBLE_VAGRANT_BOX = guits/ubuntu-bionic64

# Set the ansible inventory host file to be used according to which distrib we are running on
Expand Down
9 changes: 2 additions & 7 deletions tox-podman.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@ setenv=
# only available for ansible >= 2.5
ANSIBLE_STDOUT_CALLBACK = yaml
# Set the vagrant box image to use
CEPH_ANSIBLE_VAGRANT_BOX = centos/atomic-host
CEPH_ANSIBLE_VAGRANT_BOX = centos/8

# Set the ansible inventory host file to be used according to which distrib we are running on
INVENTORY = {env:_INVENTORY:hosts}
PLAYBOOK = site-docker.yml.sample
IS_PODMAN = TRUE
PLAYBOOK = site-container.yml.sample
CEPH_STABLE_RELEASE = nautilus

deps= -r{toxinidir}/tests/requirements.txt
Expand All @@ -48,10 +47,6 @@ commands=
ceph_docker_registry={env:CEPH_DOCKER_REGISTRY:docker.io} \
ceph_docker_image={env:CEPH_DOCKER_IMAGE:ceph/daemon} \
ceph_docker_image_tag={env:CEPH_DOCKER_IMAGE_TAG:latest-master} \
container_binary=podman \
container_package_name=podman \
container_service_name=podman \
container_binding_name=podman \
"

# wait 30sec for services to be ready
Expand Down
Loading