Standardize test vars

Move test host vars from the inventory to individual files for each
host. 'ansible_become' has been removed from localhost's vars since it
should be handled on a playbook basis. The containers' management
addresses have also been moved to the br-mgmt bridge.

Change-Id: I521ca58d07a27278864b01e02c00db43b31a0916
This commit is contained in:
Jimmy McCrory 2017-04-20 18:08:38 -07:00
parent 22c4d0911a
commit dc034ff5c3
6 changed files with 17 additions and 5 deletions

View File

@ -18,7 +18,7 @@ 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"

View File

@ -1,4 +1,7 @@
---
ansible_host: 10.100.100.2
ansible_become: True
ansible_user: root
lxc_container_config_list:
- "lxc.aa_profile=lxc-openstack"
- "lxc.mount.entry=/openstack/{{ inventory_hostname }} opt/test1 none bind 0 0"

View File

@ -1,4 +1,7 @@
---
ansible_host: 10.100.100.3
ansible_become: True
ansible_user: root
lxc_container_config_list:
- "lxc.aa_profile=unconfined"

View File

@ -0,0 +1,4 @@
---
ansible_host: 10.100.100.4
ansible_become: True
ansible_user: root

View File

@ -1,8 +1,8 @@
[all]
localhost ansible_become=True
container1 ansible_host=10.100.100.2 ansible_become=True ansible_user=root
container2 ansible_host=10.100.100.3 ansible_become=True ansible_user=root
container3 ansible_host=10.100.100.4 ansible_become=True ansible_user=root
localhost
container1
container2
container3
[all_containers]
container1

View File

@ -15,6 +15,8 @@
- name: Test whether the role produced expected results
hosts: localhost
user: root
become: true
tasks:
- name: List the running LXC containers present on the host
command: lxc-ls -1 --fancy --fancy-format name,ipv4 --running