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. Change-Id: I4f582ec3edd6ccff9573d4fb5e40e6274ea38847
This commit is contained in:
parent
12c92738c4
commit
0b9e6b4a1a
22
tests/host_vars/compute1.yml
Normal file
22
tests/host_vars/compute1.yml
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
# Copyright 2018, 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"
|
@ -13,14 +13,6 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
ansible_host: 10.1.1.1
|
|
||||||
|
|
||||||
neutron_provider_networks:
|
|
||||||
network_types: "vxlan,flat"
|
|
||||||
network_mappings: "flat:eth12"
|
|
||||||
network_vxlan_ranges: "1:1000"
|
|
||||||
neutron_local_ip: 10.1.2.1
|
|
||||||
|
|
||||||
bridges:
|
bridges:
|
||||||
- name: "br-mgmt"
|
- name: "br-mgmt"
|
||||||
ip_addr: "10.1.1.1"
|
ip_addr: "10.1.1.1"
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
localhost
|
localhost
|
||||||
infra1
|
infra1
|
||||||
openstack1
|
openstack1
|
||||||
|
compute1
|
||||||
|
|
||||||
[all_containers]
|
[all_containers]
|
||||||
infra1
|
infra1
|
||||||
@ -76,7 +77,7 @@ neutron_server
|
|||||||
openstack1
|
openstack1
|
||||||
|
|
||||||
[zun_compute]
|
[zun_compute]
|
||||||
localhost
|
compute1
|
||||||
|
|
||||||
[zun_all:children]
|
[zun_all:children]
|
||||||
zun_api
|
zun_api
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
- name: Create a zun image
|
- name: Create a zun image
|
||||||
hosts: zun_compute
|
hosts: zun_compute
|
||||||
become: true
|
remote_user: root
|
||||||
tasks:
|
tasks:
|
||||||
- name: Pull cirros image
|
- name: Pull cirros image
|
||||||
command: docker pull cirros
|
command: docker pull cirros
|
||||||
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
- name: Run zun service check
|
- name: Run zun service check
|
||||||
hosts: zun_api[0]
|
hosts: zun_api[0]
|
||||||
become: true
|
remote_user: root
|
||||||
tasks:
|
tasks:
|
||||||
- name: Check zun service is functional
|
- name: Check zun service is functional
|
||||||
shell: |
|
shell: |
|
||||||
|
Loading…
Reference in New Issue
Block a user