blob: 5e4eb0697250ee2f39da07650d5b842cdbc7e1aa [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
Andy Bavier29682912017-01-24 10:28:58 -050027 parent: fabric
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