blob: 263cbec3e74fd43ba5cf23ce8b43a9992553eec6 [file] [log] [blame]
Zack Williamsa3e40562016-07-05 12:05:39 -07001---
2- hosts: nova-compute-1
3 remote_user: ubuntu
4
5 tasks:
6 - name: Install software
7 apt:
8 name={{ item }}
9 update_cache=yes
10 cache_valid_time=3600
11 become: yes
12 with_items:
13 - lxc
14
15 # replaces: sudo sed -i 's/lxcbr0/databr/' /etc/lxc/default.conf
16 - name: set lxc bridge interface to be databr
17 become: yes
18 lineinfile:
19 dest: /etc/lxc/default.conf
20 regexp: "^lxc.network.link ="
21 line: "lxc.network.link = databr"
22
23 - name: Create testclient
24 become: yes
Andy Bavier671e5702016-07-07 21:48:18 -040025 shell: lxc-ls | grep testclient || lxc-create -t ubuntu -n testclient
Andy Baviera27effe2016-07-18 19:23:26 -040026
27 - name: Start testclient
28 become: yes
29 shell: lxc-info -n testclient -s | grep RUNNING || lxc-start -n testclient
30
31 - name: Set up networking inside the testclient for testing sample CORD subscriber
32 become: yes
33 shell: "{{ item }}"
34 with_items:
35 - "lxc-attach -n testclient -- bash -c 'ip link show eth0.222 || ip link add link eth0 name eth0.222 type vlan id 222'"
36 - "lxc-attach -n testclient -- bash -c 'ip link show eth0.222.111 || ip link add link eth0.222 name eth0.222.111 type vlan id 111'"
37 - "lxc-attach -n testclient -- ifconfig eth0.222 up"
38 - "lxc-attach -n testclient -- ifconfig eth0.222.111 up"