Zack Williams | a3e4056 | 2016-07-05 12:05:39 -0700 | [diff] [blame] | 1 | --- |
| 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 Bavier | bd1d571 | 2016-07-20 10:39:29 -0400 | [diff] [blame] | 12 | register: result |
| 13 | until: result | success |
| 14 | retries: 15 |
| 15 | delay: 60 |
Zack Williams | a3e4056 | 2016-07-05 12:05:39 -0700 | [diff] [blame] | 16 | 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 Bavier | 671e570 | 2016-07-07 21:48:18 -0400 | [diff] [blame] | 29 | shell: lxc-ls | grep testclient || lxc-create -t ubuntu -n testclient |
Andy Bavier | a27effe | 2016-07-18 19:23:26 -0400 | [diff] [blame] | 30 | |
| 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" |