From 2fe8f7e09e2413acde5c20b3522e38353e35441f Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Thu, 19 Jul 2018 19:13:17 +0100 Subject: [PATCH] Switch storage to use different inventory_hostname Our role tests execute as non-root users, and the roles need to access the environment variables for that non-root user. Ansible, when targeting localhost, changes to 'connection: local' and thus breaks everything we need to do against localhost as root unless we use 'become: true', but we if generally use that against remote hosts we lose the environment variables for the non-root user. As such, we switch the inventory to target 'compute1' instead, which has the address '10.1.1.1' (br-mgmt), so that we do not have to deal with the implict connection type changes implemented by Ansible. Depends-On: https://review.openstack.org/584033 Change-Id: I738e4ca31cd4d465d7e7eee3de052a40f7b1596a --- tests/host_vars/storage1.yml | 16 ++++++++++++++++ tests/inventory | 3 ++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 tests/host_vars/storage1.yml diff --git a/tests/host_vars/storage1.yml b/tests/host_vars/storage1.yml new file mode 100644 index 00000000..08969c0d --- /dev/null +++ b/tests/host_vars/storage1.yml @@ -0,0 +1,16 @@ +--- +# Copyright 2016, Rackspace US, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +ansible_host: "10.1.1.1" diff --git a/tests/inventory b/tests/inventory index 89ab86f1..15e1d534 100644 --- a/tests/inventory +++ b/tests/inventory @@ -3,6 +3,7 @@ localhost infra1 keystone cinder +storage1 [all_containers] infra1 @@ -45,7 +46,7 @@ cinder cinder [cinder_volume] -localhost +storage1 [cinder_all:children] cinder_api