From 067aa3aabde53decec26e83ed40c3177f58016ee Mon Sep 17 00:00:00 2001 From: Dimitri Savineau Date: Fri, 4 Oct 2019 10:07:05 -0400 Subject: [PATCH] tests: fix rgw multisite vagrant variables The secondary vagrant variables didn't have the grafana vm variable set which create an vagrant error. There was an error loading a Vagrantfile. The file being loaded and the error message are shown below. This is usually caused by an invalid or undefined variable. This patch also changes the ssh-extra-args parameter to ssh-common-args to get the same values for ssh/sftp/scp. Otherwise we can see warnings from ansible and some tasks are failing. [WARNING]: sftp transfer mechanism failed on [mon0]. Use ANSIBLE_DEBUG=1 to see detailed information It also updates the ssh-common-args value for the rgw-multisite scenario to reflect the ANSIBLE_SSH_ARGS environment variable value. Finally changing the IP addresses due to the Vagrant refact done in the commit 778c51a Signed-off-by: Dimitri Savineau (cherry picked from commit 010158ff847bb59920f6a5bbf383a1cb7056c0cf) --- tests/functional/rgw-multisite/container/hosts | 2 +- tests/functional/rgw-multisite/container/secondary/hosts | 2 +- .../container/secondary/vagrant_variables.yml | 1 + tests/functional/rgw-multisite/hosts | 2 +- tests/functional/rgw-multisite/secondary/hosts | 2 +- .../rgw-multisite/secondary/vagrant_variables.yml | 1 + tox.ini | 8 ++++---- 7 files changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/functional/rgw-multisite/container/hosts b/tests/functional/rgw-multisite/container/hosts index 6c57190d7..df1764b57 100644 --- a/tests/functional/rgw-multisite/container/hosts +++ b/tests/functional/rgw-multisite/container/hosts @@ -5,4 +5,4 @@ mon0 osd0 [rgws] -osd0 rgw_multisite_proto=http rgw_multisite_endpoint_addr=192.168.105.100 +osd0 rgw_multisite_proto=http rgw_multisite_endpoint_addr=192.168.105.11 diff --git a/tests/functional/rgw-multisite/container/secondary/hosts b/tests/functional/rgw-multisite/container/secondary/hosts index 7ba05df9a..1ed763846 100644 --- a/tests/functional/rgw-multisite/container/secondary/hosts +++ b/tests/functional/rgw-multisite/container/secondary/hosts @@ -5,4 +5,4 @@ mon0 osd0 [rgws] -osd0 copy_admin_key=True rgw_multisite=True rgw_zone=mars rgw_zonemaster=False rgw_zonesecondary=True rgw_zonegroup=solarsystem rgw_zone_user=zone.user rgw_realm=milkyway rgw_multisite_proto=http rgw_multisite_endpoint_addr=192.168.107.100 system_access_key=6kWkikvapSnHyE22P7nO system_secret_key=MGecsMrWtKZgngOHZdrd6d3JxGO5CPWgT2lcnpSt rgw_pull_proto=http rgw_pull_port=8080 rgw_pullhost=192.168.105.100 +osd0 copy_admin_key=True rgw_multisite=True rgw_zone=mars rgw_zonemaster=False rgw_zonesecondary=True rgw_zonegroup=solarsystem rgw_zone_user=zone.user rgw_realm=milkyway rgw_multisite_proto=http rgw_multisite_endpoint_addr=192.168.107.11 system_access_key=6kWkikvapSnHyE22P7nO system_secret_key=MGecsMrWtKZgngOHZdrd6d3JxGO5CPWgT2lcnpSt rgw_pull_proto=http rgw_pull_port=8080 rgw_pullhost=192.168.105.11 diff --git a/tests/functional/rgw-multisite/container/secondary/vagrant_variables.yml b/tests/functional/rgw-multisite/container/secondary/vagrant_variables.yml index 9f2b5edb2..8b89f3a41 100644 --- a/tests/functional/rgw-multisite/container/secondary/vagrant_variables.yml +++ b/tests/functional/rgw-multisite/container/secondary/vagrant_variables.yml @@ -9,6 +9,7 @@ osd_vms: 1 mds_vms: 0 rgw_vms: 0 nfs_vms: 0 +grafana_server_vms: 0 rbd_mirror_vms: 0 client_vms: 0 iscsi_gw_vms: 0 diff --git a/tests/functional/rgw-multisite/hosts b/tests/functional/rgw-multisite/hosts index 48c12701d..abf3b0deb 100644 --- a/tests/functional/rgw-multisite/hosts +++ b/tests/functional/rgw-multisite/hosts @@ -5,4 +5,4 @@ mon0 osd0 [rgws] -osd0 rgw_multisite_proto=http rgw_multisite_endpoint_addr=192.168.101.100 +osd0 rgw_multisite_proto=http rgw_multisite_endpoint_addr=192.168.101.11 diff --git a/tests/functional/rgw-multisite/secondary/hosts b/tests/functional/rgw-multisite/secondary/hosts index 1e119a24f..d295bf353 100644 --- a/tests/functional/rgw-multisite/secondary/hosts +++ b/tests/functional/rgw-multisite/secondary/hosts @@ -5,4 +5,4 @@ mon0 osd0 [rgws] -osd0 rgw_multisite=True rgw_zone=mars rgw_zonemaster=False rgw_zonesecondary=True rgw_zonegroup=solarsystem rgw_zone_user=zone.user rgw_realm=milkyway rgw_multisite_proto=http rgw_multisite_endpoint_addr=192.168.103.100 system_access_key=6kWkikvapSnHyE22P7nO system_secret_key=MGecsMrWtKZgngOHZdrd6d3JxGO5CPWgT2lcnpSt rgw_pull_proto=http rgw_pull_port=8080 rgw_pullhost=192.168.101.100 +osd0 rgw_multisite=True rgw_zone=mars rgw_zonemaster=False rgw_zonesecondary=True rgw_zonegroup=solarsystem rgw_zone_user=zone.user rgw_realm=milkyway rgw_multisite_proto=http rgw_multisite_endpoint_addr=192.168.103.11 system_access_key=6kWkikvapSnHyE22P7nO system_secret_key=MGecsMrWtKZgngOHZdrd6d3JxGO5CPWgT2lcnpSt rgw_pull_proto=http rgw_pull_port=8080 rgw_pullhost=192.168.101.11 diff --git a/tests/functional/rgw-multisite/secondary/vagrant_variables.yml b/tests/functional/rgw-multisite/secondary/vagrant_variables.yml index 80f58d09e..54573d9bc 100644 --- a/tests/functional/rgw-multisite/secondary/vagrant_variables.yml +++ b/tests/functional/rgw-multisite/secondary/vagrant_variables.yml @@ -9,6 +9,7 @@ osd_vms: 1 mds_vms: 0 rgw_vms: 0 nfs_vms: 0 +grafana_server_vms: 0 rbd_mirror_vms: 0 client_vms: 0 iscsi_gw_vms: 0 diff --git a/tox.ini b/tox.ini index 143fa724f..86b5fc014 100644 --- a/tox.ini +++ b/tox.ini @@ -321,12 +321,12 @@ commands= commands= bash -c "cd {changedir}/secondary && vagrant up --no-provision {posargs:--provider=virtualbox}" bash -c "cd {changedir}/secondary && bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir}/secondary" - ansible-playbook --ssh-extra-args='-F {changedir}/secondary/vagrant_ssh_config' -vv -i {changedir}/secondary/hosts {toxinidir}/tests/functional/setup.yml - ansible-playbook --ssh-extra-args='-F {changedir}/secondary/vagrant_ssh_config' -vv -i {changedir}/secondary/hosts {toxinidir}/tests/functional/lvm_setup.yml + ansible-playbook --ssh-common-args='-F {changedir}/secondary/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey' -vv -i {changedir}/secondary/hosts {toxinidir}/tests/functional/setup.yml + ansible-playbook --ssh-common-args='-F {changedir}/secondary/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey' -vv -i {changedir}/secondary/hosts {toxinidir}/tests/functional/lvm_setup.yml # ensure the rule isn't already present ansible -i localhost, all -c local -b -m iptables -a 'chain=FORWARD protocol=tcp source=192.168.0.0/16 destination=192.168.0.0/16 jump=ACCEPT action=insert rule_num=1 state=absent' ansible -i localhost, all -c local -b -m iptables -a 'chain=FORWARD protocol=tcp source=192.168.0.0/16 destination=192.168.0.0/16 jump=ACCEPT action=insert rule_num=1 state=present' - ansible-playbook --ssh-extra-args='-F {changedir}/secondary/vagrant_ssh_config' -vv -i {changedir}/secondary/hosts {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "\ + ansible-playbook --ssh-common-args='-F {changedir}/secondary/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey' -vv -i {changedir}/secondary/hosts {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "\ ireallymeanit=yes \ fetch_directory={env:FETCH_DIRECTORY:{changedir}/secondary/fetch} \ ceph_stable_release={env:CEPH_STABLE_RELEASE:nautilus} \ @@ -335,7 +335,7 @@ commands= ceph_docker_image_tag={env:CEPH_DOCKER_IMAGE_TAG:latest-master} \ " ansible-playbook -vv -i {changedir}/hosts {toxinidir}/tests/functional/rgw_multisite.yml --extra-vars "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}" - ansible-playbook -vv --ssh-extra-args='-F {changedir}/secondary/vagrant_ssh_config' -i {changedir}/secondary/hosts {toxinidir}/tests/functional/rgw_multisite.yml --extra-vars "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}" + ansible-playbook --ssh-common-args='-F {changedir}/secondary/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey' -vv -i {changedir}/secondary/hosts {toxinidir}/tests/functional/rgw_multisite.yml --extra-vars "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}" bash -c "cd {changedir}/secondary && vagrant destroy --force" # clean rule after the scenario is complete ansible -i localhost, all -c local -b -m iptables -a 'chain=FORWARD protocol=tcp source=192.168.0.0/16 destination=192.168.0.0/16 jump=ACCEPT action=insert rule_num=1 state=absent'