Andy Bavier | 30d27c9 | 2016-09-15 15:59:17 -0400 | [diff] [blame] | 1 | --- |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 2 | # maas-test-client-install/tasks/main.yml |
| 3 | |
Andy Bavier | bef5628 | 2016-11-14 08:22:43 -0800 | [diff] [blame] | 4 | - name: Create testclient LXD profile |
| 5 | lxd_profile: |
| 6 | name: testclient |
| 7 | state: present |
| 8 | config: |
| 9 | user.user-data: | |
| 10 | #cloud-config |
| 11 | write_files: |
| 12 | - path: /etc/rc.local |
| 13 | permissions: "0755" |
| 14 | content: | |
| 15 | #!/bin/sh -e |
| 16 | # Set up VLAN tagging interface ("simulated OLT") |
| 17 | ip link add link eth0 name eth0.222 type vlan id 222 |
| 18 | ip link add link eth0.222 name eth0.222.111 type vlan id 111 |
| 19 | ifconfig eth0.222 up |
| 20 | ifconfig eth0.222.111 up |
| 21 | dhclient eth0.222.111 |
| 22 | exit 0 |
| 23 | bootcmd: |
| 24 | - sed -i 's/eth0 inet dhcp/eth0 inet manual/g' /etc/network/interfaces.d/eth0.cfg |
| 25 | description: 'Subscriber test client' |
| 26 | devices: |
| 27 | eth0: |
Andy Bavier | b9b5700 | 2016-11-23 17:01:36 -0500 | [diff] [blame] | 28 | nictype: macvlan |
Andy Bavier | 2968291 | 2017-01-24 10:28:58 -0500 | [diff] [blame] | 29 | parent: fabric |
Andy Bavier | bef5628 | 2016-11-14 08:22:43 -0800 | [diff] [blame] | 30 | type: nic |
| 31 | |
| 32 | - name: Create testclient container |
| 33 | lxd_container: |
| 34 | name: testclient |
| 35 | architecture: x86_64 |
| 36 | state: started |
| 37 | source: |
| 38 | type: image |
| 39 | mode: pull |
| 40 | server: https://cloud-images.ubuntu.com/releases |
| 41 | protocol: simplestreams |
| 42 | alias: "{{ ansible_distribution_release }}" |
| 43 | profiles: ["testclient"] |
| 44 | timeout: 600 |
| 45 | |
| 46 | - name: Stop container |
| 47 | lxd_container: |
| 48 | name: testclient |
| 49 | state: stopped |
Andy Bavier | b83beac | 2016-10-20 15:54:08 -0400 | [diff] [blame] | 50 | register: result |
| 51 | until: result | success |
Andy Bavier | bef5628 | 2016-11-14 08:22:43 -0800 | [diff] [blame] | 52 | retries: 3 |
| 53 | delay: 10 |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 54 | |