blob: 6b225b9db00ce210593530e9540ba9debed0bb9b [file] [log] [blame]
Andy Bavier30d27c92016-09-15 15:59:17 -04001---
Zack Williamsa2763112017-01-03 11:38:38 -07002# maas-test-client-install/tasks/main.yml
3
Andy Bavierbef56282016-11-14 08:22:43 -08004- 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 Bavierb9b57002016-11-23 17:01:36 -050028 nictype: macvlan
Andy Bavier29682912017-01-24 10:28:58 -050029 parent: fabric
Andy Bavierbef56282016-11-14 08:22:43 -080030 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 Bavierb83beac2016-10-20 15:54:08 -040050 register: result
51 until: result | success
Andy Bavierbef56282016-11-14 08:22:43 -080052 retries: 3
53 delay: 10
Zack Williamsa2763112017-01-03 11:38:38 -070054