From e665d8e23999e0469eeffa6d1182339338358155 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Mon, 6 Jan 2020 17:31:46 +0100 Subject: [PATCH] tests: upgrade from octopus to octopus on master we can't test upgrade from stable-4.0/CentOS 7 to master/CentOS 8. This commit refact the upgrade so we test upgrade from master/CentOS 8 to master/CentOS 8 (octopus to octopus) Signed-off-by: Guillaume Abrioux --- infrastructure-playbooks/rolling_update.yml | 25 ++++----------------- tox-update.ini | 25 ++++++++------------- 2 files changed, 13 insertions(+), 37 deletions(-) diff --git a/infrastructure-playbooks/rolling_update.yml b/infrastructure-playbooks/rolling_update.yml index 04539d128..782ab1dab 100644 --- a/infrastructure-playbooks/rolling_update.yml +++ b/infrastructure-playbooks/rolling_update.yml @@ -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 @@ -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 diff --git a/tox-update.ini b/tox-update.ini index 610331446..bad667f50 100644 --- a/tox-update.ini +++ b/tox-update.ini @@ -31,39 +31,32 @@ setenv= container: PLAYBOOK = site-docker.yml.sample non_container: PLAYBOOK = site.yml.sample - CEPH_DOCKER_IMAGE_TAG = latest-nautilus UPDATE_CEPH_DOCKER_IMAGE_TAG = latest-master UPDATE_CEPH_DEV_BRANCH = master UPDATE_CEPH_DEV_SHA1 = latest - CEPH_STABLE_RELEASE = nautilus ROLLING_UPDATE = True - +deps= -r{toxinidir}/tests/requirements.txt changedir={toxinidir}/tests/functional/all_daemons{env:CONTAINER_DIR:} commands= vagrant up --no-provision {posargs:--provider=virtualbox} bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir} - # use the stable-4.0 branch to deploy a nautilus cluster - git clone -b stable-4.0 --single-branch https://github.com/ceph/ceph-ansible.git {envdir}/tmp/ceph-ansible - pip install -r {envdir}/tmp/ceph-ansible/tests/requirements.txt - - bash -c 'ANSIBLE_CONFIG={envdir}/tmp/ceph-ansible/ansible.cfg ansible-playbook -vv -i {changedir}/{env:INVENTORY} {envdir}/tmp/ceph-ansible/tests/functional/setup.yml' + ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/tests/functional/setup.yml # configure lvm - bash -c 'ANSIBLE_CONFIG={envdir}/tmp/ceph-ansible/ansible.cfg ansible-playbook -vv -i {changedir}/{env:INVENTORY} {envdir}/tmp/ceph-ansible/tests/functional/lvm_setup.yml --extra-vars "osd_scenario=lvm"' + ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/tests/functional/lvm_setup.yml - # deploy the cluster - ansible-playbook -vv -i {envdir}/tmp/ceph-ansible/tests/functional/all_daemons{env:CONTAINER_DIR:}/hosts {envdir}/tmp/ceph-ansible/{env:PLAYBOOK:site.yml.sample} --extra-vars "\ + non_container: ansible-playbook -vv -i "localhost," -c local {toxinidir}/tests/functional/dev_setup.yml --extra-vars "dev_setup=True change_dir={changedir} ceph_dev_branch={env:UPDATE_CEPH_DEV_BRANCH:master} ceph_dev_sha1={env:UPDATE_CEPH_DEV_SHA1:latest}" --tags "vagrant_setup" + ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "\ delegate_facts_host={env:DELEGATE_FACTS_HOST:True} \ fetch_directory={env:FETCH_DIRECTORY:{changedir}/fetch} \ - ceph_stable_release={env:CEPH_STABLE_RELEASE:nautilus} \ 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-nautilus} \ + ceph_docker_image={env:UPDATE_CEPH_DOCKER_IMAGE:ceph/daemon} \ + ceph_docker_image_tag={env:UPDATE_CEPH_DOCKER_IMAGE_TAG:latest-master} \ + ceph_dev_branch={env:UPDATE_CEPH_DEV_BRANCH:master} \ + ceph_dev_sha1={env:UPDATE_CEPH_DEV_SHA1:latest} \ " - pip install -r {toxinidir}/tests/requirements.txt - non_container: ansible-playbook -vv -i "localhost," -c local {toxinidir}/tests/functional/dev_setup.yml --extra-vars "dev_setup=True change_dir={changedir} ceph_dev_branch={env:UPDATE_CEPH_DEV_BRANCH:master} ceph_dev_sha1={env:UPDATE_CEPH_DEV_SHA1:latest}" --tags "vagrant_setup" ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/infrastructure-playbooks/rolling_update.yml --extra-vars "\ ireallymeanit=yes \ fetch_directory={env:FETCH_DIRECTORY:{changedir}/fetch} \ -- 2.39.5