From af190195b1407580d908c28af962e2b473b98c85 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Thu, 19 Jul 2018 19:02:54 +0100 Subject: [PATCH] Switch compute 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: I6e6f586844f4945ebbeffe17da4cd16083d43771 --- tests/host_vars/compute1.yml | 21 +++++++++++++++++++++ tests/host_vars/localhost.yml | 6 ------ tests/inventory | 5 +++-- 3 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 tests/host_vars/compute1.yml diff --git a/tests/host_vars/compute1.yml b/tests/host_vars/compute1.yml new file mode 100644 index 00000000..fc0d4ade --- /dev/null +++ b/tests/host_vars/compute1.yml @@ -0,0 +1,21 @@ +--- +# 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 +neutron_local_ip: 10.1.2.1 +neutron_provider_networks: + network_types: "vxlan,flat" + network_mappings: "flat:eth12" + network_vxlan_ranges: "1:1000" diff --git a/tests/host_vars/localhost.yml b/tests/host_vars/localhost.yml index 5135ead5..f88d96b8 100644 --- a/tests/host_vars/localhost.yml +++ b/tests/host_vars/localhost.yml @@ -13,12 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -neutron_provider_networks: - network_types: "vxlan,flat" - network_mappings: "flat:eth12" - network_vxlan_ranges: "1:1000" -neutron_local_ip: 10.1.2.1 -ansible_python_interpreter: "/usr/bin/python2" bridges: - name: "br-mgmt" ip_addr: "10.1.1.1" diff --git a/tests/inventory b/tests/inventory index e651cd96..36200172 100644 --- a/tests/inventory +++ b/tests/inventory @@ -2,6 +2,7 @@ localhost infra1 openstack1 +compute1 [all_containers] infra1 @@ -47,8 +48,8 @@ openstack1 openstack1 [neutron_linuxbridge_agent] +compute1 openstack1 -localhost [neutron_openvswitch_agent] @@ -85,7 +86,7 @@ openstack1 openstack1 [nova_compute] -localhost +compute1 [nova_conductor] openstack1