blob: 7526cf4fa8e52a5d1220f39ebf4f9d209726975c [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
Andy Bavierbd1d5712016-07-20 10:39:29 -040012 register: result
13 until: result | success
14 retries: 15
15 delay: 60
Zack Williamsa3e40562016-07-05 12:05:39 -070016 with_items:
17 - lxc
18
19 # replaces: sudo sed -i 's/lxcbr0/databr/' /etc/lxc/default.conf
20 - name: set lxc bridge interface to be databr
21 become: yes
22 lineinfile:
23 dest: /etc/lxc/default.conf
24 regexp: "^lxc.network.link ="
25 line: "lxc.network.link = databr"
26
27 - name: Create testclient
28 become: yes
Andy Bavier671e5702016-07-07 21:48:18 -040029 shell: lxc-ls | grep testclient || lxc-create -t ubuntu -n testclient
Andy Baviera27effe2016-07-18 19:23:26 -040030
31 - name: Start testclient
32 become: yes
33 shell: lxc-info -n testclient -s | grep RUNNING || lxc-start -n testclient
34
35 - name: Set up networking inside the testclient for testing sample CORD subscriber
36 become: yes
37 shell: "{{ item }}"
38 with_items:
39 - "lxc-attach -n testclient -- bash -c 'ip link show eth0.222 || ip link add link eth0 name eth0.222 type vlan id 222'"
40 - "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'"
41 - "lxc-attach -n testclient -- ifconfig eth0.222 up"
42 - "lxc-attach -n testclient -- ifconfig eth0.222.111 up"