blob: ffae72e21abde54443d4de495f958e5e6aa2abda [file] [log] [blame]
Zack Williams18b6f022018-01-19 11:46:54 -07001---
Matteo Scandolo3896c472017-08-01 13:31:42 -07002# 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
Zack Williams18b6f022018-01-19 11:46:54 -070016# test-client-install/tasks/main.yml
Zack Williamsa2763112017-01-03 11:38:38 -070017
Andy Bavierbef56282016-11-14 08:22:43 -080018- name: Create testclient LXD profile
19 lxd_profile:
20 name: testclient
21 state: present
22 config:
23 user.user-data: |
24 #cloud-config
25 write_files:
26 - path: /etc/rc.local
27 permissions: "0755"
28 content: |
29 #!/bin/sh -e
30 # Set up VLAN tagging interface ("simulated OLT")
31 ip link add link eth0 name eth0.222 type vlan id 222
32 ip link add link eth0.222 name eth0.222.111 type vlan id 111
33 ifconfig eth0.222 up
34 ifconfig eth0.222.111 up
35 dhclient eth0.222.111
36 exit 0
37 bootcmd:
38 - sed -i 's/eth0 inet dhcp/eth0 inet manual/g' /etc/network/interfaces.d/eth0.cfg
39 description: 'Subscriber test client'
40 devices:
41 eth0:
Andy Bavierb9b57002016-11-23 17:01:36 -050042 nictype: macvlan
Zack Williams18b6f022018-01-19 11:46:54 -070043 parent: "{{ headnode_fabric_bridge }}"
Andy Bavierbef56282016-11-14 08:22:43 -080044 type: nic
45
46- name: Create testclient container
47 lxd_container:
48 name: testclient
49 architecture: x86_64
50 state: started
51 source:
52 type: image
53 mode: pull
54 server: https://cloud-images.ubuntu.com/releases
55 protocol: simplestreams
56 alias: "{{ ansible_distribution_release }}"
57 profiles: ["testclient"]
58 timeout: 600
59
60- name: Stop container
61 lxd_container:
62 name: testclient
63 state: stopped
Andy Bavierb83beac2016-10-20 15:54:08 -040064 register: result
Zack Williamsf6cc0122018-03-30 16:00:49 -070065 until: result is success
Andy Bavierbef56282016-11-14 08:22:43 -080066 retries: 3
67 delay: 10
Zack Williamsa2763112017-01-03 11:38:38 -070068