tests: force docker variable for switch-to-containers scenario

we need to force the value of `docker` variable which is initially set
to `false` since it's a migration from non-containerized to
containerized cluster.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
pull/1812/head
Guillaume Abrioux 2017-09-05 15:18:01 +02:00 committed by Sébastien Han
parent b7db600caa
commit d987d26719
3 changed files with 68 additions and 6 deletions

View File

@ -30,9 +30,9 @@
hosts:
- "{{ mon_group_name|default('mons') }}"
- "{{ mgr_group_name|default('mgrs') }}"
- "{{ osd_group_name|default('osds') }}"
- "{{ mds_group_name|default('mdss') }}"
- "{{ mgr_group_name|default('mgrs') }}"
- "{{ rgw_group_name|default('rgws') }}"
- "{{ rbdmirror_group_name|default('rbdmirrors') }}"
- "{{ nfs_group_name|default('nfss') }}"
@ -136,6 +136,48 @@
delegate_to: "{{ mon_host }}"
- name: switching from non-containerized to containerized ceph mgr
hosts:
- "{{ mgr_group_name|default('mgrs') }}"
vars:
containerized_deployment: true
mgr_group_name: mgrs
serial: 1
become: true
pre_tasks:
- name: stop non-containerized ceph mgr(s)
service:
name: "ceph-mgr@{{ ansible_hostname }}"
state: stopped
enabled: no
- set_fact:
ceph_uid: 64045
when: ceph_docker_image_tag | match("latest") or ceph_docker_image_tag | search("ubuntu")
- set_fact:
ceph_uid: 167
when: ceph_docker_image_tag | search("centos") or ceph_docker_image | search("rhceph") or ceph_docker_image_tag | search("fedora")
- name: set proper ownership on ceph directories
file:
path: "{{ item }}"
owner: "{{ ceph_uid }}"
recurse: yes
with_items:
- /var/lib/ceph
- /etc/ceph
roles:
- ceph-defaults
- ceph-docker-common
- ceph-mgr
- name: switching from non-containerized to containerized ceph osd
vars:

View File

@ -0,0 +1,22 @@
[all:vars]
docker=True
[mons]
ceph-mon0 monitor_address=192.168.1.10
ceph-mon1 monitor_interface=eth1
ceph-mon2 monitor_address=192.168.1.12
[osds]
ceph-osd0
[mdss]
ceph-mds0
[rgws]
ceph-rgw0
[clients]
ceph-client0
[mgrs]
ceph-mgr0

View File

@ -1,6 +1,6 @@
[tox]
envlist = {dev,jewel,luminous,rhcs}-{ansible2.2,ansible2.3}-{xenial_cluster,journal_collocation,centos7_cluster,dmcrypt_journal,dmcrypt_journal_collocation,docker_cluster,purge_cluster,purge_dmcrypt,docker_dedicated_journal,docker_dmcrypt_journal_collocation,update_dmcrypt,update_cluster,cluster,purge_docker_cluster,update_docker_cluster}
{dev,luminous}-{ansible2.2,ansible2.3}-{bluestore_journal_collocation,bluestore_cluster,bluestore_dmcrypt_journal,bluestore_dmcrypt_journal_collocation,bluestore_docker_cluster,bluestore_docker_dedicated_journal,bluestore_docker_dmcrypt_journal_collocation,lvm_osds,purge_lvm_osds,shrink_mon,shrink_osd,switch_to_containers}
envlist = {dev,jewel,luminous,rhcs}-{ansible2.2,ansible2.3}-{xenial_cluster,journal_collocation,centos7_cluster,dmcrypt_journal,dmcrypt_journal_collocation,docker_cluster,purge_cluster,purge_dmcrypt,docker_dedicated_journal,docker_dmcrypt_journal_collocation,update_dmcrypt,update_cluster,cluster,purge_docker_cluster,update_docker_cluster,switch_to_containers}
{dev,luminous}-{ansible2.2,ansible2.3}-{bluestore_journal_collocation,bluestore_cluster,bluestore_dmcrypt_journal,bluestore_dmcrypt_journal_collocation,bluestore_docker_cluster,bluestore_docker_dedicated_journal,bluestore_docker_dmcrypt_journal_collocation,lvm_osds,purge_lvm_osds,shrink_mon,shrink_osd}
skipsdist = True
@ -109,8 +109,7 @@ commands=
ceph_dev_sha1={env:UPDATE_CEPH_DEV_SHA1:latest} \
"
echo "docker: True" >> {changedir}/group_vars/all
testinfra -n 4 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts {toxinidir}/tests/functional/tests
testinfra -n 4 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts-switch-to-containers {toxinidir}/tests/functional/tests
[testenv]
whitelist_externals =
@ -118,7 +117,6 @@ whitelist_externals =
bash
pip
cp
echo
passenv=*
sitepackages=True
setenv=