blob: 6dd1c2b7db35892edc7789f585b2084d59649aea [file] [log] [blame]
Andy Bavier30d27c92016-09-15 15:59:17 -04001---
Andy Bavierbef56282016-11-14 08:22:43 -08002- name: Create testclient LXD profile
3 lxd_profile:
4 name: testclient
5 state: present
6 config:
7 user.user-data: |
8 #cloud-config
9 write_files:
10 - path: /etc/rc.local
11 permissions: "0755"
12 content: |
13 #!/bin/sh -e
14 # Set up VLAN tagging interface ("simulated OLT")
15 ip link add link eth0 name eth0.222 type vlan id 222
16 ip link add link eth0.222 name eth0.222.111 type vlan id 111
17 ifconfig eth0.222 up
18 ifconfig eth0.222.111 up
19 dhclient eth0.222.111
20 exit 0
21 bootcmd:
22 - sed -i 's/eth0 inet dhcp/eth0 inet manual/g' /etc/network/interfaces.d/eth0.cfg
23 description: 'Subscriber test client'
24 devices:
25 eth0:
Andy Bavierb9b57002016-11-23 17:01:36 -050026 nictype: macvlan
27 parent: eth3
Andy Bavierbef56282016-11-14 08:22:43 -080028 type: nic
29
30- name: Create testclient container
31 lxd_container:
32 name: testclient
33 architecture: x86_64
34 state: started
35 source:
36 type: image
37 mode: pull
38 server: https://cloud-images.ubuntu.com/releases
39 protocol: simplestreams
40 alias: "{{ ansible_distribution_release }}"
41 profiles: ["testclient"]
42 timeout: 600
43
44- name: Stop container
45 lxd_container:
46 name: testclient
47 state: stopped
Andy Bavierb83beac2016-10-20 15:54:08 -040048 register: result
49 until: result | success
Andy Bavierbef56282016-11-14 08:22:43 -080050 retries: 3
51 delay: 10