From 7e6fb6845c1d4a6dce706a85c1e75bb9fdbc409f Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Tue, 16 May 2017 12:04:48 +0100 Subject: [PATCH] Fix role gate tests for Ansible 2.3 Add 'become' and root 'user' options to the playbook instead of using 'ansible_become' through an inventory variable. Change-Id: Ic89c3786b51d6b3416e4d3903fde4d46dbe7ade2 --- tests/group_vars/all_containers.yml | 4 ++-- tests/host_vars/container1.yml | 18 ++++++++++++++++++ tests/host_vars/container2.yml | 18 ++++++++++++++++++ tests/host_vars/container3.yml | 18 ++++++++++++++++++ tests/inventory | 8 ++++---- tests/test-rabbitmq-server-functional.yml | 6 +++--- 6 files changed, 63 insertions(+), 9 deletions(-) create mode 100644 tests/host_vars/container1.yml create mode 100644 tests/host_vars/container2.yml create mode 100644 tests/host_vars/container3.yml diff --git a/tests/group_vars/all_containers.yml b/tests/group_vars/all_containers.yml index 83ce0212..f37df47c 100644 --- a/tests/group_vars/all_containers.yml +++ b/tests/group_vars/all_containers.yml @@ -17,9 +17,9 @@ container_name: "{{ inventory_hostname }}" container_networks: management_address: address: "{{ ansible_host }}" - bridge: "lxcbr0" + bridge: "br-mgmt" interface: "eth1" - netmask: "255.255.252.0" + netmask: "255.255.255.0" type: "veth" physical_host: localhost properties: diff --git a/tests/host_vars/container1.yml b/tests/host_vars/container1.yml new file mode 100644 index 00000000..37954c2f --- /dev/null +++ b/tests/host_vars/container1.yml @@ -0,0 +1,18 @@ +--- +# Copyright 2017, 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 diff --git a/tests/host_vars/container2.yml b/tests/host_vars/container2.yml new file mode 100644 index 00000000..10225aba --- /dev/null +++ b/tests/host_vars/container2.yml @@ -0,0 +1,18 @@ +--- +# Copyright 2017, 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 diff --git a/tests/host_vars/container3.yml b/tests/host_vars/container3.yml new file mode 100644 index 00000000..e937748c --- /dev/null +++ b/tests/host_vars/container3.yml @@ -0,0 +1,18 @@ +--- +# Copyright 2017, 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.4 +ansible_become: True +ansible_user: root diff --git a/tests/inventory b/tests/inventory index cb6e5df4..45457f42 100644 --- a/tests/inventory +++ b/tests/inventory @@ -1,8 +1,8 @@ [all] -localhost ansible_become=True -container1 ansible_host=10.100.100.101 ansible_become=True ansible_user=root -container2 ansible_host=10.100.100.102 ansible_become=True ansible_user=root -container3 ansible_host=10.100.100.103 ansible_become=True ansible_user=root +localhost +container1 +container2 +container3 [rabbitmq_all_other] container1 diff --git a/tests/test-rabbitmq-server-functional.yml b/tests/test-rabbitmq-server-functional.yml index fbe780f3..cc64a25f 100644 --- a/tests/test-rabbitmq-server-functional.yml +++ b/tests/test-rabbitmq-server-functional.yml @@ -26,9 +26,9 @@ delegate_to: "{{ item }}" when: ansible_host == item with_items: - - 10.100.100.101 - - 10.100.100.102 - - 10.100.100.103 + - 10.1.0.2 + - 10.1.0.3 + - 10.1.0.4 - name: Open rabbitmq.config slurp: src: "/etc/rabbitmq/rabbitmq.config"