blob: c802a834d1e2db6582bcb4cf28ea6069c3fdf262 [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
Zack Williams35624562016-08-28 17:12:26 -070030 tags:
31 - skip_ansible_lint # FIXME: should used lxc_container module
Andy Baviera27effe2016-07-18 19:23:26 -040032
33 - name: Start testclient
34 become: yes
35 shell: lxc-info -n testclient -s | grep RUNNING || lxc-start -n testclient
Zack Williams35624562016-08-28 17:12:26 -070036 tags:
37 - skip_ansible_lint # FIXME: should used lxc_container module
Andy Baviera27effe2016-07-18 19:23:26 -040038
39 - name: Set up networking inside the testclient for testing sample CORD subscriber
40 become: yes
41 shell: "{{ item }}"
42 with_items:
43 - "lxc-attach -n testclient -- bash -c 'ip link show eth0.222 || ip link add link eth0 name eth0.222 type vlan id 222'"
44 - "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'"
45 - "lxc-attach -n testclient -- ifconfig eth0.222 up"
46 - "lxc-attach -n testclient -- ifconfig eth0.222.111 up"
Zack Williams35624562016-08-28 17:12:26 -070047 tags:
48 - skip_ansible_lint # non-trivial use case