blob: 45a29f72c9a98ea4ae2ccbc8c180e8851350d6fb [file] [log] [blame]
Matteo Scandolo3896c472017-08-01 13:31:42 -07001
2# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16
Andy Bavier30d27c92016-09-15 15:59:17 -040017---
Zack Williamsa2763112017-01-03 11:38:38 -070018# maas-test-client-install/tasks/main.yml
19
Andy Bavierbef56282016-11-14 08:22:43 -080020- name: Create testclient LXD profile
21 lxd_profile:
22 name: testclient
23 state: present
24 config:
25 user.user-data: |
26 #cloud-config
27 write_files:
28 - path: /etc/rc.local
29 permissions: "0755"
30 content: |
31 #!/bin/sh -e
32 # Set up VLAN tagging interface ("simulated OLT")
33 ip link add link eth0 name eth0.222 type vlan id 222
34 ip link add link eth0.222 name eth0.222.111 type vlan id 111
35 ifconfig eth0.222 up
36 ifconfig eth0.222.111 up
37 dhclient eth0.222.111
38 exit 0
39 bootcmd:
40 - sed -i 's/eth0 inet dhcp/eth0 inet manual/g' /etc/network/interfaces.d/eth0.cfg
41 description: 'Subscriber test client'
42 devices:
43 eth0:
Andy Bavierb9b57002016-11-23 17:01:36 -050044 nictype: macvlan
Andy Bavier29682912017-01-24 10:28:58 -050045 parent: fabric
Andy Bavierbef56282016-11-14 08:22:43 -080046 type: nic
47
48- name: Create testclient container
49 lxd_container:
50 name: testclient
51 architecture: x86_64
52 state: started
53 source:
54 type: image
55 mode: pull
56 server: https://cloud-images.ubuntu.com/releases
57 protocol: simplestreams
58 alias: "{{ ansible_distribution_release }}"
59 profiles: ["testclient"]
60 timeout: 600
61
62- name: Stop container
63 lxd_container:
64 name: testclient
65 state: stopped
Andy Bavierb83beac2016-10-20 15:54:08 -040066 register: result
67 until: result | success
Andy Bavierbef56282016-11-14 08:22:43 -080068 retries: 3
69 delay: 10
Zack Williamsa2763112017-01-03 11:38:38 -070070