Skip to content

Commit

Permalink
tests: upgrade from octopus to octopus
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
guits authored and dsavineau committed Jan 6, 2020
1 parent 8450cc6 commit 1e7053d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 37 deletions.
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
25 changes: 9 additions & 16 deletions tox-update.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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} \
Expand Down

0 comments on commit 1e7053d

Please sign in to comment.