From 79c252fb268d9472076834e140135158d6a8253d Mon Sep 17 00:00:00 2001 From: Jimmy McCrory Date: Sat, 20 Oct 2018 15:28:29 -0700 Subject: [PATCH] Set container_name as host_var in test inventory The connection plugin no longer falls back on using the inventory_hostname as the container_name. Set container_name as a host var for each container in the test inventory. Change-Id: I42d691a2f01918932006984f9f68af9df1c7e41f --- tests/group_vars/all_containers.yml | 3 +-- tests/host_vars/infra1.yml | 19 +++++++++++++++++++ tests/host_vars/localhost.yml | 3 ++- tests/host_vars/openstack1.yml | 19 +++++++++++++++++++ tests/inventory | 4 ++-- 5 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 tests/host_vars/infra1.yml create mode 100644 tests/host_vars/openstack1.yml diff --git a/tests/group_vars/all_containers.yml b/tests/group_vars/all_containers.yml index d644759..f54c3b6 100644 --- a/tests/group_vars/all_containers.yml +++ b/tests/group_vars/all_containers.yml @@ -14,11 +14,10 @@ # limitations under the License. ansible_host: "{{ ansible_host }}" -container_name: "{{ inventory_hostname }}" container_networks: management_address: address: "{{ ansible_host }}" - bridge: "lxcbr0" + bridge: "br-mgmt" interface: "eth1" netmask: "255.255.252.0" type: "veth" diff --git a/tests/host_vars/infra1.yml b/tests/host_vars/infra1.yml new file mode 100644 index 0000000..fcf92eb --- /dev/null +++ b/tests/host_vars/infra1.yml @@ -0,0 +1,19 @@ +--- +# 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.0.2 +ansible_become: True +ansible_user: root +container_name: infra1 diff --git a/tests/host_vars/localhost.yml b/tests/host_vars/localhost.yml index 65ddeaa..f7fc7d6 100644 --- a/tests/host_vars/localhost.yml +++ b/tests/host_vars/localhost.yml @@ -14,6 +14,7 @@ # limitations under the License. bridges: - - "br-mgmt" + - name: "br-mgmt" + ip_addr: "10.1.0.1" ansible_python_interpreter: "/usr/bin/python2" diff --git a/tests/host_vars/openstack1.yml b/tests/host_vars/openstack1.yml new file mode 100644 index 0000000..0290962 --- /dev/null +++ b/tests/host_vars/openstack1.yml @@ -0,0 +1,19 @@ +--- +# 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.0.3 +ansible_become: True +ansible_user: root +container_name: openstack1 diff --git a/tests/inventory b/tests/inventory index d7194e6..8ada4f9 100644 --- a/tests/inventory +++ b/tests/inventory @@ -1,7 +1,7 @@ [all] localhost -infra1 ansible_host=10.100.100.2 ansible_host=10.100.100.2 ansible_become=True ansible_user=root -openstack1 ansible_host=10.100.100.3 ansible_host=10.100.100.3 ansible_become=True ansible_user=root +infra1 +openstack1 [all_containers] infra1